Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Do not require wss when target host is loopback address #129

Closed
achingbrain opened this issue May 13, 2021 · 2 comments
Closed

Do not require wss when target host is loopback address #129

achingbrain opened this issue May 13, 2021 · 2 comments

Comments

@achingbrain
Copy link
Member

This line makes dialling a local node from a webworker or browser over websockets impossible without also setting up WSS which makes writing tests for things a whole lot harder.

This check should be relaxed as the browser will allow regular WS connections to loopback addresses without requiring SSL, since traffic cannot be snooped on by malicious third parties when it does not leave the host machine. Other processes on your computer may snoop, but if that's happening you are already compromised.

@achingbrain
Copy link
Member Author

See e2610b2 (#3386) for an example

@vasco-santos
Copy link
Member

Hey!

Please see #116 for reasoning behind and https://github.com/libp2p/js-libp2p-websockets/releases/tag/v0.15.0 on how you should configure libp2p for testing (some js-ipfs tests already do this).

Doing what you suggest will basically move us to the same problem we had in the past. Peers advertise their loopback addresses (and we cannot control this), which means we will attempt to dial them using websockets and all the errors in the browser will be back.

Do you have an alternative solution in mind to work around this? IMHO I agree that needing to do the configuration linked above is annoying and also adds the need to add the filter for local testing/Development (we have this in the docs/examples), but in a production environment such dials should not happen.

@lidel lidel closed this as completed Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants