Client: Firefox: does not connect to local ethereum node unless configured under wss

Created on 9 Oct 2019  路  9Comments  路  Source: aragon/client

Describe the bug

In network preferences, I can't set ethereum node url to my local geth node running under with ws (rather than wss).

Firefox does not allow going from https to ws.

Mainnet or testnet?

mainnet

Organization

Any organization.

https://mainnet.aragon.org/#/?preferences=/network

To Reproduce

I'm running a geth node with the following command:

geth --syncmode=light --rpc --ws

On Aragon portal:

  1. Go to global preferences.
  2. Change ethereum node to ws://127.0.0.1:8546.
  3. Press "Save changes".
  4. See error "Could not connect to node".

No trace in JS console.

Expected behavior

Web UI should successfully connect to local node.


  • OS and OS version: Arch Linux
  • Browser and browser version: Firefox 68.0.2
documentation

All 9 comments

@xuhcc I think usually the ws endpoint is on /ws (not 100% sure though), so you might have to use ws://127.0.0.1:8546/ws.

Otherwise, it looks like there might be some CORS settings to turn on: https://ethereum.stackexchange.com/a/11619

Hello @sohkai
I tried to use ws://127.0.0.1:8546/ws and run geth with --wsorigins="*" flag, but still no connection (and no errors in console).

@xuhcc Are you able to connect to it via other tools, e.g. wscat?

Yes, wscat works:

$ wscat --connect ws://127.0.0.1:8546/
connected (press CTRL+C to quit)
> {"id": 1, "method": "eth_syncing", "params": []}
< {"jsonrpc":"2.0","id":1,"result":false}

It appears to work in Chromium, so only Firefox is affected.

Odd; thanks for testing!

Which version of geth are you using?

v1.9.3-stable-cfbb969d/linux-amd64/go1.13

Firefox disallows insecure websocket connections when website uses https:

https://stackoverflow.com/questions/11768221/firefox-websocket-security-issue

The solution was to set network.websocket.allowInsecureFromHTTPS setting to true in about:config. Or just run aragon client locally.

Thanks for figuring this out @xuhcc! We should turn this into a support FAQ :).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luisivan picture luisivan  路  4Comments

john-light picture john-light  路  3Comments

ricburton picture ricburton  路  3Comments

luisivan picture luisivan  路  4Comments

sohkai picture sohkai  路  3Comments