Closed pasqui23 closed 4 years ago
Hey, I don't think there's much I can do about WebRTC requiring a TURN server for your case. It might be a firewall issue, though. 😅
Is the page successfully connecting to your local ws proxy? I think at the moment ws proxies don't connect browsers together since it assumes they can connect over WebRTC.
Would adding config options for presenting a TURN server help your use case?
Yes,an option for a TURN server would be good.It would be good also an option to use both wrtc and websocket proxy toghether.
What do you mean firewall issue?
Update:even after adding
simplePeer: {
iceServers:require("./turn.jsonc")
}
To the options passed to the hyperswarm-web constructor,the problem still remain intact
turn.jsonc is taken from https://gist.github.com/yetithefoot/7592580
This under the assumption that simplePeer
is an object that get passed to the constructor of simple-peer
which then passes it to RTCPeerConnection
@tinchoz49 Should passing simplePeer
in that format to discovery-swarm-webrtc work?
Hey everyone!
Doing:
simplePeer: {
iceServers:require("./turn.jsonc")
}
wont work, simplePeer is an object of options for the simplePeer instance so you need to follow the spec options here: https://github.com/feross/simple-peer#peer--new-peeropts
that means:
simplePeer: {
config: { iceServers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:global.stun.twilio.com:3478?transport=udp' }] }
}
Remember to pass an Array of objects.
Awesome, thank you for clarifying Martin! 💜
@pasqui23 Would you be down for sending a PR to add some documentation on setting up STUN and TURN servers in the README once you've got it working? 😁
@RangerMauve done https://github.com/RangerMauve/hyperswarm-web/pull/2
As seen in https://github.com/pasqui23/.hswm-bug After doing
And open 2 broswer tabs at
http://localhost:1234
After sending a username,If I then send a message I get in the js consoleEven through a ws proxy on localhost should run (thanks to
node bin/hyperswarm.js
)