-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Issue in setting up a signaling-server: peerjs.min.js?a0bc:52 WebSocket connection failed #193
Comments
ERR_SSL_PROTOCOL_ERROR - if you are using the wss:// socket, you need to provide a ssl certificate.
Alternatively, (if you are using localhost), you could set
|
Hi @Florrr ! With:
I still don't get the connection between the two peers (desktop and mobile phone): |
But it seems that the connection to the signaling-server has been established (since there is no error) Has the connection worked previously with the public peerjs signaling-server? EDIT: |
The connection worked perfectly fine till yesterday with public peerjs signaling-server. Yes, now I'm trying to use a signaling server located at the same server as the web-server.
But I got this error messages: So, I suppose, I should keep trying to locate the signaling server on the same machine of the web-server. |
@Florrr do I need to explicitly create the Peer also for the mobile part?
But, as far as I understand from here https://flaviocopes.com/peerjs/
What I do not understand is why I see the first peer, the desktop peer, connecting:
But I do not see connecting the second peer, the mobile peer |
When changing the host from I'd recommend following this setup guide: https://peerjs.com/docs.html#api |
Till now I didn't use any ssl key and ssl cert. This is why I do not understand when you say "changing the host from localhost to a public ip": till yesterday both Peer objects were connected to the public signaling-server. Now that I host my own signaling-server, do I have to specify an ssl key an ssl cert for https ( https://github.com/peers/peerjs-server#using-https )? Can I use as ssl key and ssl cert the ones I defined for certbot, or do I need to define different ssl cert and key? If they must be different than the ones I already have for certbot, what's the best way to get new ones? I'm using different ids for each peer-object Just to understand how the workflow works, I issued self-signed ssl key and cert. peerjs --port 9000 --sslkey /home/marco/myTempCerts/my.key --sslcert /home/marco/myTempCerts/my.crt and specified the path to key and crt within both peer objects:
But I get this error:
|
Sorry for confusing you..
is for the server sided peers-server code. e.g:
Since you are using localhost, try to debug without ssl-certificates Could you provide your full javascript-code? Otherwise it's really hard to see whats wrong |
@Florrr This is the entire code related to the messages exchange between the two peer objects:
Both running the peerjs-server as:
or as:
when accessing the page from another pc or laptop I get this kind of error: GET http://localhost:9000/peerjs/id?ts=15905756285960.6529121162 |
Your
Also: I'm pretty sure such errors should be logged in the console. Consider debugging using the remote tools provided in #193 (comment) |
Hi @Florrr with the following vue file :
the connection between the peer objects doesn't happen. But if I click the address of the peer-server which the peer mobile object doesn't seem to connect to, I get this: So my question is: |
With this vue file:
I still on the mobile part: http://localhost:9000/peerjs/id?ts=15916344913130.5114210203945029 net::ERR_CONNECTION_REFUSED Should I setup my own signaling server? Is this guide a good starting point? https://meetrix.io/blog/webrtc/how-to-setup-a-signaling-server.html |
hi ,all |
I have found a solution for a similar kind of problem. Actually, the peer server runs on HTTP protocol, and for making it run on HTTPS protocol, we need to generate an SSL key and certificate. Even after generating these things, it will only run on the localhost server and the systems connected to that network. There is a peer server hosted on a Heroku, so it is running on HTTPS, rather than using your own peer server, we can use the path of the Heroku peer server and then host the app on some hosting website, The app will run properly. Below is my new client-side code. I also review your last attempt, I'm also quoting that attempt. peer = new Peer({host:'peerjs-server.herokuapp.com', secure:true, port:443})
|
In Ubuntu 18.04.4 Desktop with node v14.3.0,
I made various attempts to setting up a signaling-server, but got errors.
My app is running behind an nginx proxy server.
First attempt:
in Peerjs.vue file:
data: () => ({
peerServer: PeerServer({
port: 9000,
path: '/ggc',
}),
But when I run npm run server I get this error:
2nd attempt:
I tried to run the signaling server in this simpler way:
going to the address http://127.0.0.1:9000/myapp
But I get this error:
net::ERR_SSL_PROTOCOL_ERROR
3rd attempt:
If I don't specify any id when connecting to the server from the client PeerJS:
I get this other error:
4th attempt:
I also tried to run the Peer Signaling Server as follows:
nano peerjs_server.js :
But I get this error:
5th attempt:
I discovered here: https://flaviocopes.com/peerjs/
that I can run peerjs server using npx:
in Peerjs.vue file :
But got this error:
Wha am I doing wrongly?
How to solve the problem?
Looking forward to your kind help.
Marco
The text was updated successfully, but these errors were encountered: