bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Proxy port in URI

Open srvkb01 opened this issue 1 year ago • 8 comments

Hello,

I try to use bruno 1.6.1 in a windows10 professional environment (mitm proxy https, Web Gateway, firewall...). I send all my traffic through a local http proxy :

"proxy": {
			"enabled": true,
			"protocol": "http",
			"hostname": "127.0.0.1",
			"port": 31280,
			"auth": {
				"enabled": false,
				"username": "",
				"password": ""
			},
			"bypassProxy": ""
		}

When I try to get https request :

meta {
  name: simple get
  type: http
  seq: 1
}

get {
  url: https://reqres.in/api/users
  body: none
  auth: none
}

bruno send bad, he add the proxy port to the uri hostname https://reqres.in:31280/api/users
and get error Error invoking remote method 'send-http-request': Error: socket hang up

Frame 68: 304 bytes on wire (2432 bits), 304 bytes captured (2432 bits) on interface \Device\NPF_Loopback, id 7
Internet Protocol Version 4, Src: localhost (127.0.0.1), Dst: localhost (127.0.0.1)
Transmission Control Protocol, Src Port: 50914 (50914), Dst Port: 31280 (31280), Seq: 1, Ack: 1, Len: 260
Hypertext Transfer Protocol
    GET https://reqres.in:31280/api/users HTTP/1.1\r\n
    Accept: application/json, text/plain, */*\r\n
    request-start-time: 1706195677467\r\n
    User-Agent: axios/1.5.1\r\n
    Accept-Encoding: gzip, compress, deflate, br\r\n
    host: reqres.in\r\n
    Proxy-Connection: close\r\n
    Connection: close\r\n
    \r\n
    [Full request URI: https://reqres.in:31280/api/users]
    [HTTP request 1/1]

I got the same with http request : GET http://reqres.in:31280/api/users HTTP/1.1\r\n

I very much appreciate your app and wish it the success it deserves

Kind regards,

srvkb01 avatar Jan 25 '24 15:01 srvkb01

I experience similar issues, but the problem is not just the port. The authority part "https://reqres.in" should be in the host header and the GET method should only contain the path. Like this:

GET /api/users HTTP/1.1
Host: reqres.in
...

I am using Bruno version 1.7.1

rfmae avatar Feb 02 '24 13:02 rfmae

Issue still persists in 1.10.0

Some CNTLM logs to illustrate the issue:

Bruno:

******* Round 1 C: 4 *******
Reading headers (4)...
HEAD: GET https://api.mistral.ai:3128/v1/models HTTP/1.1

Curl:

******* Round 1 C: 4 *******
Reading headers (4)...
HEAD: CONNECT api.mistral.ai:443 HTTP/1.1

Also: The DevTools don't show anything in the network tab for these requests.

Can someone acknowledge this and maybe give some insights/roadmap?

SC-CTS avatar Mar 11 '24 14:03 SC-CTS

I have the same issue.

I made a bug report to http-proxy lib (https://github.com/TooTallNate/proxy-agents/issues/298) I made a PR #1883

Please test this PR and confirm it's the same issue and that the PR fixes the bug for you. I made a release for my convenience here: https://github.com/samuel-deal-tisseo/bruno/releases/tag/v1.12.3-sam But you should try the PR itself for security reasons

Thank you

samuel-deal-tisseo avatar Mar 21 '24 13:03 samuel-deal-tisseo

Hello,

I will try with the 1.12.3-sam version, it's good for me : image

Thanks !

srvkb01 avatar Mar 28 '24 09:03 srvkb01

Great to here that :) I hope It will be merged upstream soon

samuel-deal-tisseo avatar Mar 28 '24 09:03 samuel-deal-tisseo

Tried both 1.18.0 Windows and Linux. Having the same issue.

Windows proxy log: image

Linux proxy log: image

gaac510 avatar Jun 05 '24 03:06 gaac510

Having the same issue on version 1.24.0 on Linux.

Proxy is correctly contacted, but the proxy port is added to the original request when it shouldn't.

IGNBPesty avatar Aug 12 '24 15:08 IGNBPesty

Same issue here in Windows with version 1.26.1

MarcoDroll avatar Aug 23 '24 08:08 MarcoDroll