usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.39k stars 1.26k forks source link

Proxy port in URI #1448

Closed srvkb01 closed 1 month ago

srvkb01 commented 9 months ago

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,

rfmae commented 9 months ago

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

SC-CTS commented 8 months ago

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?

samuel-deal-tisseo commented 8 months ago

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

srvkb01 commented 7 months ago

Hello,

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

Thanks !

samuel-deal-tisseo commented 7 months ago

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

gaac510 commented 5 months ago

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

Windows proxy log: image

Linux proxy log: image

IGNBPesty commented 3 months ago

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.

MarcoDroll commented 2 months ago

Same issue here in Windows with version 1.26.1

helloanoop commented 1 month ago

This issue has already been fixed in latest version of Bruno v1.30.1 Closing this issue. Please reopen the issue if the problem still persists,