-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow HTTP (not HTTPS) on postwoman.io #175
Comments
Browser will block any resources (scripts , link , iframe , XMLHttpRequest, fetch) to download if original html page is in https and requested resources are in http. Browser throws an Mixed Content error.
Only work around I found is to tweak browser security policies and allow http requests. I'll update when I find another tweak. |
Maybe we should use a proxy server. send the request to proxy server fetch HTTP request on the server and then return back the response to Postwoman client. |
Proxy implementation with Nuxt middleware is planned. @hosseinnedaee would you like to work on this feature? |
@liyasthomas yeah sure |
@hosseinnedaee #2 had an active discussion around implementing middleware for proxy. This not only allow us to request for http but also solves CORS issues. NBTX is busy and couldn't follow this. Later our team took it to telegram group chat for further discussions. Follow from this thread for discussion https://t.me/postwoman_app/72 https://blog.lichter.io/posts/nuxt-with-an-api/ this article discusses different methods for implementing middleware. |
@liyasthomas Assign me to this issue. |
websocket support on this? |
@NBTX is working on proxy mode for WebSocket. |
need help? |
@frankli0324 we would love to have this feature implemented. do contribute. |
will take a look next week... got some schedules this weekend |
what I've done so far: I tried to create a single nginx server configuration for anyone who wants to build up their own proxy server installing as less things as possible:
and made a little change diff --git a/components/realtime/websocket.vue b/components/realtime/websocket.vue
index fba150e..9c7e56c 100644
--- a/components/realtime/websocket.vue
+++ b/components/realtime/websocket.vue
@@ -103,7 +101,19 @@ export default {
},
]
try {
- this.socket = new WebSocket(this.url)
+ if (this.$store.state.postwoman.settings.PROXY_ENABLED) {
+ const original = new URL(this.url);
+ const proxy = new URL("your_proxy_server");
+ let proto = original.protocol;
+ proxy.searchParams.append("scheme", proto.substr(0, proto.length-1));
+ proxy.searchParams.append("target", original.hostname);
+ proxy.searchParams.append("port", original.port);
+ proxy.searchParams.append("path", original.pathname);
+ proxy.searchParams.append("query", original.searchParams.toString());
+ this.socket = new WebSocket(proxy);
+ }
+ else
+ this.socket = new WebSocket(this.url)
this.socket.onopen = event => {
this.connectionState = true
this.communication.log = [ still trying to adopt the original version of http proxy server so we could use a single proxy for both types of requests |
demo: https://proxy.frankli.site |
Any progress? When developing it is very common to deploy on Thanks! p.s. @franeli0324's site seems to be down. |
For localhost endpoints, you should install Browser Extension (link in readme). For other non-https endpoints turn-on Proxy from Settings> Proxy. *The latest Chrome extension is having a minor bug which has been fixed but is currently under review. Kindly use another browser (Firefox) local endpoints. |
Thanks! I just searched the plugin but find it 404, so I will turn to firefox or wait |
Buggy version has been taken down - use Firefox / Proxy mode. |
OK thanks! By the way I find another solution: Disable Chrome's security check for this particular webpage in chrome's setting. |
I'm trying to access an internal http host. Couldnt get it working in anyway. Any suggestions? |
@idling-mind turn on Proxy Mode from Settings. |
Currently postwoman.io redirects insecure requests to HTTPS.
Whilst this is often desirable, it prevents us from testing HTTP-only sites.
So essentially, we just need to disable this redirect.
The text was updated successfully, but these errors were encountered: