[GH-ISSUE #175] Allow HTTP (not HTTPS) on postwoman.io #68

Closed
opened 2026-03-16 13:09:11 +03:00 by kerem · 20 comments
Owner

Originally created by @NBTX on GitHub (Oct 1, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/175

Originally assigned to: @hosseinnedaee on GitHub.

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.

Originally created by @NBTX on GitHub (Oct 1, 2019). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/175 Originally assigned to: @hosseinnedaee on GitHub. 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.
kerem 2026-03-16 13:09:11 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@liyasthomas commented on GitHub (Oct 2, 2019):

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.

https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content

Only work around I found is to tweak browser security policies and allow http requests.

Screen Shot 2019-10-02 at 9 29 35 AM

I'll update when I find another tweak.

<!-- gh-comment-id:537324620 --> @liyasthomas commented on GitHub (Oct 2, 2019): 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. > https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content Only work around I found is to tweak browser security policies and allow http requests. ![Screen Shot 2019-10-02 at 9 29 35 AM](https://user-images.githubusercontent.com/10395817/66017174-51169400-e4f7-11e9-931c-f0c4abeaae29.png) I'll update when I find another tweak.
Author
Owner

@hosseinnedaee commented on GitHub (Oct 11, 2019):

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.

<!-- gh-comment-id:540969392 --> @hosseinnedaee commented on GitHub (Oct 11, 2019): 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.
Author
Owner

@liyasthomas commented on GitHub (Oct 11, 2019):

Proxy implementation with Nuxt middleware is planned. @hosseinnedaee would you like to work on this feature?

<!-- gh-comment-id:540979806 --> @liyasthomas commented on GitHub (Oct 11, 2019): Proxy implementation with Nuxt middleware is planned. @hosseinnedaee would you like to work on this feature?
Author
Owner

@hosseinnedaee commented on GitHub (Oct 11, 2019):

@liyasthomas yeah sure
do you have any idea about implementation or I just start to work on it?

<!-- gh-comment-id:541010453 --> @hosseinnedaee commented on GitHub (Oct 11, 2019): @liyasthomas yeah sure do you have any idea about implementation or I just start to work on it?
Author
Owner

@liyasthomas commented on GitHub (Oct 11, 2019):

@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.

<!-- gh-comment-id:541014655 --> @liyasthomas commented on GitHub (Oct 11, 2019): @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.
Author
Owner

@hosseinnedaee commented on GitHub (Oct 12, 2019):

@liyasthomas Assign me to this issue.

<!-- gh-comment-id:541346518 --> @hosseinnedaee commented on GitHub (Oct 12, 2019): @liyasthomas Assign me to this issue.
Author
Owner

@frankli0324 commented on GitHub (Nov 19, 2019):

websocket support on this?

<!-- gh-comment-id:555519176 --> @frankli0324 commented on GitHub (Nov 19, 2019): websocket support on this?
Author
Owner

@liyasthomas commented on GitHub (Nov 19, 2019):

@NBTX is working on proxy mode for WebSocket.

<!-- gh-comment-id:555519730 --> @liyasthomas commented on GitHub (Nov 19, 2019): @NBTX is working on proxy mode for WebSocket.
Author
Owner

@frankli0324 commented on GitHub (Apr 17, 2020):

need help?

<!-- gh-comment-id:615266147 --> @frankli0324 commented on GitHub (Apr 17, 2020): need help?
Author
Owner

@liyasthomas commented on GitHub (Apr 17, 2020):

@frankli0324 we would love to have this feature implemented. do contribute.

<!-- gh-comment-id:615267315 --> @liyasthomas commented on GitHub (Apr 17, 2020): @frankli0324 we would love to have this feature implemented. do contribute.
Author
Owner

@frankli0324 commented on GitHub (Apr 18, 2020):

will take a look next week... got some schedules this weekend

<!-- gh-comment-id:615901743 --> @frankli0324 commented on GitHub (Apr 18, 2020): will take a look next week... got some schedules this weekend
Author
Owner

@frankli0324 commented on GitHub (Apr 28, 2020):

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:

server {
	server_name your_own_doman;
	listen 443 ssl;
	include /etc/nginx/conf.d/ssl; # certificate, key
	resolver 8.8.8.8;
	location / {
		if ( $arg_target = '' ) { return 403 'null target'; }
		if ( $arg_scheme = '' ) { set $arg_scheme 'http'; }
		if ( $arg_scheme = 'ws' ) { set $arg_scheme 'http'; }
		if ( $arg_scheme = 'wss' ) { set $arg_scheme 'https'; }
		if ( $arg_scheme = 'http' ) { set $port '80'; }
		if ( $arg_scheme = 'https' ) { set $port '443'; }
		if ( $arg_port != '' ) { set $port $arg_port; }
		set $query '';
		set $path '';
		rewrite_by_lua_block { # on debian/ubuntu: libnginx-mod-http-lua
        	ngx.var.query = ngx.unescape_uri(ngx.var.arg_query)
			ngx.var.path = ngx.unescape_uri(ngx.var.arg_path)
        }
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass $arg_scheme://$arg_target:$port$path?$query;
	}
}

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

<!-- gh-comment-id:620393909 --> @frankli0324 commented on GitHub (Apr 28, 2020): 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: ```conf server { server_name your_own_doman; listen 443 ssl; include /etc/nginx/conf.d/ssl; # certificate, key resolver 8.8.8.8; location / { if ( $arg_target = '' ) { return 403 'null target'; } if ( $arg_scheme = '' ) { set $arg_scheme 'http'; } if ( $arg_scheme = 'ws' ) { set $arg_scheme 'http'; } if ( $arg_scheme = 'wss' ) { set $arg_scheme 'https'; } if ( $arg_scheme = 'http' ) { set $port '80'; } if ( $arg_scheme = 'https' ) { set $port '443'; } if ( $arg_port != '' ) { set $port $arg_port; } set $query ''; set $path ''; rewrite_by_lua_block { # on debian/ubuntu: libnginx-mod-http-lua ngx.var.query = ngx.unescape_uri(ngx.var.arg_query) ngx.var.path = ngx.unescape_uri(ngx.var.arg_path) } proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass $arg_scheme://$arg_target:$port$path?$query; } } ``` and made a little change ```diff 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
Author
Owner

@frankli0324 commented on GitHub (Apr 28, 2020):

demo: https://proxy.frankli.site
btw the original proxy is down

<!-- gh-comment-id:620405452 --> @frankli0324 commented on GitHub (Apr 28, 2020): demo: https://proxy.frankli.site btw the original proxy is down
Author
Owner

@fzyzcjy commented on GitHub (Jul 8, 2020):

Any progress? When developing it is very common to deploy on localhost with HTTP not HTTPS. Thus this feature is very desired and will be commonly used.

Thanks!

p.s. @franeli0324's site seems to be down.

<!-- gh-comment-id:655342552 --> @fzyzcjy commented on GitHub (Jul 8, 2020): Any progress? When developing it is very common to deploy on `localhost` with HTTP not HTTPS. Thus this feature is very desired and will be commonly used. Thanks! p.s. @franeli0324's site seems to be down.
Author
Owner

@liyasthomas commented on GitHub (Jul 8, 2020):

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.

<!-- gh-comment-id:655344873 --> @liyasthomas commented on GitHub (Jul 8, 2020): 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.
Author
Owner

@fzyzcjy commented on GitHub (Jul 8, 2020):

Thanks! I just searched the plugin but find it 404, so I will turn to firefox or wait

<!-- gh-comment-id:655400398 --> @fzyzcjy commented on GitHub (Jul 8, 2020): Thanks! I just searched the plugin but find it 404, so I will turn to firefox or wait
Author
Owner

@liyasthomas commented on GitHub (Jul 8, 2020):

Buggy version has been taken down - use Firefox / Proxy mode.

<!-- gh-comment-id:655400947 --> @liyasthomas commented on GitHub (Jul 8, 2020): Buggy version has been taken down - use Firefox / Proxy mode.
Author
Owner

@fzyzcjy commented on GitHub (Jul 8, 2020):

OK thanks!

By the way I find another solution: Disable Chrome's security check for this particular webpage in chrome's setting.

<!-- gh-comment-id:655493687 --> @fzyzcjy commented on GitHub (Jul 8, 2020): OK thanks! By the way I find another solution: Disable Chrome's security check for this particular webpage in chrome's setting.
Author
Owner

@idling-mind commented on GitHub (Aug 3, 2021):

I'm trying to access an internal http host. Couldnt get it working in anyway. Any suggestions?

<!-- gh-comment-id:891953490 --> @idling-mind commented on GitHub (Aug 3, 2021): I'm trying to access an internal http host. Couldnt get it working in anyway. Any suggestions?
Author
Owner

@liyasthomas commented on GitHub (Aug 3, 2021):

@idling-mind turn on Proxy Mode from Settings.

<!-- gh-comment-id:892004816 --> @liyasthomas commented on GitHub (Aug 3, 2021): @idling-mind turn on Proxy Mode from [Settings](https://hoppscotch.io/settings).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#68
No description provided.