Closed Bug 1607235 Opened 4 years ago Closed 4 years ago

websockets do not establish with manual proxy configuration as from FF71

Categories

(Core :: Networking: WebSockets, defect, P3)

71 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1601871

People

(Reporter: cedric.vanlabeke, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

  • The following was seen on MacOS >= 10.14 and Windows 10 with Firefox 71.0. Other browsers like Chromium are not affected.

  • The problem was first seen on internal web applications using websockets behind enterprise Proxy servers. Later on reproduced using squid running locally on my own machine.

Steps to reproduce the problem:

  1. Configure a good working proxy server in the 'manual proxy configuration'

1.a - If you do not have a proxy available available, the following can let you reproduce quickly using Docker:

  • Run a local Squid listening on port 3128:
    docker run --name squid -d --publish 3128:3128 pires/docker-squid
  • Configure your browser to point to: localhost port 3128

1.b. Go to http://websocket.org/echo.html (! http, not https!). The page should show a proxy server error, since the above image only supports https. You now verified that your local squid proxy works.

  1. Go to https://websocket.org/echo.html . The page should load just fine

  2. Click the Connect button. You should see "CONNECTED" appear in the log window.

Actual results:

The websocket does not establish when going through a manually configured proxy.

Expected results:

  • In Firefox 70 and below, the websockets ws:// and wss:// established just fine.

  • In browsers like Chrome, everything works fine as well.

  • Only in Firefox 71, the websocket establishing fails when a proxy server is configured.

  • When in Firefox 71, the proxy is set to 'use system-settings', it works, but that might be because of bug https://bugzilla.mozilla.org/show_bug.cgi?id=1601671 making the connection not go through any proxy.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Networking: WebSockets
Product: Firefox → Core

Does the proxy require authentication?

Flags: needinfo?(cedric.vanlabeke)

No authentication needed, pure pass-through (like how it works in the docker image).

Flags: needinfo?(cedric.vanlabeke)
Assignee: nobody → honzab.moz
Priority: -- → P3
Whiteboard: [necko-triaged]
See Also: → 1608090

I tested it on Linux with latest nightly and it works correctly. Could you please attach a screenshot from proxy setting and also provide a log? https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging

Flags: needinfo?(cedric.vanlabeke)

Hi Michal, thanks for looking into this. Have you used the exact steps as I wrote above? That's very weird to see it works for you... .

Please see https://github.com/cvanlabe/1607235 . It contains both the screenshot and the HTTP log.

Note that I have tried to use Socksv4 and Socksv5, without any difference in behaviour. The logs were taken using the settings seen in the screenshot. Behavior was reproduced using a private browser window.

Let me know if anything else is needed.

Flags: needinfo?(cedric.vanlabeke)

(In reply to Cedric from comment #5)

Please see https://github.com/cvanlabe/1607235 . It contains both the screenshot and the HTTP log.

Note that I have tried to use Socksv4 and Socksv5, without any difference in behaviour. The logs were taken using the settings seen in the screenshot. Behavior was reproduced using a private browser window.

This setting is wrong. You misunderstood the recommendation in bug 1601871. You should uncheck "Use this proxy for all protocols" options and then set all proxy settings correctly. In case you don't have SOCKS proxy in you network, then clear SOCKS Host field. With your setting, Firefox tries to connect to squid using SOCKS protocol for websocket channel.

Hi Michal!

Thanks, indeed I misunderstood that part. I confirm websockets do work when you do not have the SOCKS host configured. Which explains why the 'use for all protocols' is causing websockets to fail. However, the 'use for all protocols' is commonly set by all browser implementations, and how it used to be with versions prior to 71, so I do think the SOCKS handling needs to be more transparent from an enduser perspective.

I think we can then duplicate this bug to bug 1601871?

Thanks again for your help!

Thank you, guys, for diagnosing this. I will dis-assign now.

Assignee: honzab.moz → nobody
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

(In reply to Cedric from comment #7)

However, the 'use for all protocols' is commonly set by all browser implementations, and how it used to be with versions prior to 71, so I do think the SOCKS handling needs to be more transparent from an enduser perspective.

Bug 969282 changed 'use for all protocols' so it doesn't override SOCKS proxy. It will be in Firefox 73.

You need to log in before you can comment on or make changes to this bug.