Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket connection failed #1

Open
stupicode opened this issue Aug 31, 2021 · 6 comments
Open

WebSocket connection failed #1

stupicode opened this issue Aug 31, 2021 · 6 comments

Comments

@stupicode
Copy link

gun.js:1670 WebSocket connection to 'ws://localhost:8765/gun' failed.

@SmilinJasper
Copy link

Did you solve it yet?

@tylerjharden
Copy link

tylerjharden commented Dec 3, 2021

How did you produce this error?

@SmilinJasper
Copy link

How did you produce this error?

I think it is caused by AdBlocker maybe blocking WebRTC

@anesuc
Copy link

anesuc commented Jan 15, 2022

Ad blockers do not just block all WebRTC connections, that would be an insane thing to do. You would essentially be blocking an entire web protocol lol. You would have to have a specific extension designed to block WebRTC connections maybe to prevent an IP leak etc.

In this case thats because there isn't a websocket on that port as far as I know from briefly looking at the code. We never started a server on that port.

@ArvindGundimajalu
Copy link

ArvindGundimajalu commented Jan 23, 2022

Not sure if this is related but I see this error come up when I try deploying it on AWS "'web socket connection to wss://gun-manhattan.herokuapp.com/gun failed'. Any idea what could be going wrong"

@anesuc
Copy link

anesuc commented Jan 23, 2022

Not sure if this is related but I see this error come up when I try deploying it on AWS "'web socket connection to wss://gun-manhattan.herokuapp.com/gun failed'. Any idea what could be going wrong"

Do you have a websocket server ruining on that? If not, thats the reason. You need to a gun server like (this is an example of running one on locahost, haven't fully tested this or anything but should give you an idea):

const server = require('http').createServer().listen(8765);
  new Gun({
    web: server,
  });

I myself have abandoned this for now because if all users leave, it forgets the data only until you restart the server does it then load the saved data. In other words you would have to restart the server everytime there was no activity (no other peers to get the data from)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants