Henrik Skupin c193147b7b Bug 1769994 - [remote] Resolve localhost to an IP before starting httpd.js. r=webdriver-reviewers,jdescottes
By resolving localhost to an actual IP for the httpd.js server
allows us to supply unique URLs for the CDP and WebDriver BiDi
WebSocket connection details and CDP's JSON handler end-points.

Hereby the first resolved IP will be used which should always be
the local IPv4 address (127.0.0.1). If IPv4 is disabled `[::1]`
will be used.

It will prevent issues especially on dualstack systems where DNS
resolution might prefer IPv6 over IPv4 (like with node.js > 16).

Differential Revision: https://phabricator.services.mozilla.com/D154151
2022-08-19 18:48:49 +00:00
..

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

These files provide functionality for serving and responding to HTTP
requests, and handling WebSocket connections.  For this we rely on
httpd.js and the chrome-only WebSocket.createServerWebSocket function.

Generally speaking, this is all held together with a piece of string.
It is a known problem that we do not have a high-quality HTTPD
implementation in central, and wed like to move away from using
any of this code.