Firefox unable to connect to WebSocket on localhost

RESOLVED FIXED in Firefox 39

Status

()

RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: randall.h.wood, Assigned: mcmanus)

Tracking

26 Branch
mozilla39
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(firefox39 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20131205075310

Steps to reproduce:

I have an application, JMRI (http://jmri.org), running on OS X 10.9. This application supports both HTTP and WebSockets clients on port 12080. I am running this application on the same host as the Firefox 26.0 client.


Actual results:

Firefox successfully makes HTTP requests when connecting to http://localhost:12080 and http://127.0.0.1:12080 without issue, but can only establish WebSocket connections to ws://127.0.0.1:12080; attempts to connect to ws://localhost:12080 fail.
Safari on the same computer successfully connects to ws://localhost:12080 and ws://127.0.0.1:12080 without issue.


Expected results:

I expected that Firefox would be able to establish the WebSocket connection to both localhost and 127.0.0.1 without issue.

Comment 1

4 years ago
Created attachment 8564881 [details] [diff] [review]
offline-localhost

map localhost to 127.0.0.1 only in offline mode

Hello Patrick,
Could I have your review? 
Thanks.
Assignee: nobody → juhsu
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8564881 - Flags: review?(mcmanus)

Comment 2

4 years ago
break the try; cancel the review, sorry
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2d07bed7cd9e

Updated

4 years ago
Attachment #8564881 - Flags: review?(mcmanus)
(Assignee)

Comment 3

4 years ago
Created attachment 8565018 [details] [diff] [review]
make localhost resolve offline
Attachment #8565018 - Flags: review?(dd.mozilla)
(Assignee)

Updated

4 years ago
Assignee: juhsu → mcmanus
Status: NEW → ASSIGNED
(Assignee)

Comment 5

4 years ago
The patch makes the resolution of localhost while offline preffable - with a default to true (i.e. yes - resolve). The reason I made it preffable was some tests were explicitly testing offline result codes and we require the test infrastructure to use localhost - so they need to be accommodated.
Comment on attachment 8565018 [details] [diff] [review]
make localhost resolve offline

Review of attachment 8565018 [details] [diff] [review]:
-----------------------------------------------------------------

looks good.
Attachment #8565018 - Flags: review?(dd.mozilla) → review+
sorry had to back this out since i think this caused frequent OS X Test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=6670898&repo=mozilla-inbound
Flags: needinfo?(mcmanus)
(Assignee)

Comment 9

4 years ago
services/sync/tests/unit/test_errorhandler_sync_checkServerError.js needed  Services.prefs.setBoolPref("network.dns.offline-localhost", false) as the test actively probes offline behavior.
Flags: needinfo?(mcmanus)

Updated

4 years ago
Duplicate of this bug: 1131006
(Assignee)

Comment 14

4 years ago
Junior- you'll need to debug that gaia pinyin test if you want to land this.. thanks!
Assignee: mcmanus → juhsu
Component: Networking: WebSockets → Networking
Nevermind, it wasn't yours after all (sorry). I've got it queued to re-land once I sort out what actually was at fault.
(Assignee)

Updated

4 years ago
Assignee: juhsu → nobody
https://hg.mozilla.org/mozilla-central/rev/c49df0e00b59
Assignee: nobody → mcmanus
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
status-firefox39: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.