christian-bromann / devtools-backend

Standalone implementation of the Chrome DevTools backend to debug arbitrary web environments.
Apache License 2.0
143 stars 23 forks source link

PROXY_NETWORK_ADDRESS should not be equal os.hostname #5

Open Efefefef opened 6 years ago

Efefefef commented 6 years ago

I use proxy server locally to inject the script into the app running in the browser When the app name appears in the panel I click it and it tries to connect to ws and get websocket connection failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

Socket result url is ws://macbook-pro.local:9222/devtools/page/0abece5a-33ef-4c1b-bdef-ef1e79848a9e

I suppose it should be ws://localhost:9222/blabla The weird address comes from PROXY_NETWORK_ADDRESS variable in proxy.js If the process.env.PROXY_NETWORK_ADDRESS is not specified it should not be equal os.hostname() but localhost The result for os.hostname() in my case is MacBook-Pro.local