Closed faienz93 closed 6 years ago
WebSocket connection to 'wss://mydomain/peerjs
You are trying to connect to a PeerServer in the domain "mydomain" which is not a valid domain name
I don't know why location.hostname is being populated with "mydomain"
mmm no, "my domain" is a github pages of my project. Now i change the domain with the url of my server and i post the result.
ok, i have resolved. Setting as HOST the url of my server and setting the port on 443 the connection is establish.
Best regards Antonio Faienza
i am facing some issue few days, anybody please help me failed: Error during WebSocket handshake: Unexpected response code: 404 in this file main-unminified.js
ok, i have resolved. Setting as HOST the url of my server and setting the port on 443 the connection is establish.
Best regards Antonio Faienza
Doesn't work on Heroku
. I get permission errors.
@yegow it works on Heroku server hosted too,while creating peer,
const newPeer = new Peer(id, {
host:'youdomain.com',
port: 443,
secure: true
});
Hello everyone, i have finished my project using PeerJs and for test it i have decide to deploy the component of my project. For this, i deploy my server on Heroku. Regarding the client I have changed my point of access from
const PEER_CLIENT = { HOST: "localhost", PORT: 9000, PATH: "/peerjs" }
to
const PEER_CLIENT = { HOST: location.hostname, PORT: location.port || (location.protocol === 'https:' ? 443 : 80), PATH: "/peerjs" }
but I obtain the same error:
WebSocket connection to 'wss://mydomain/peerjs/peerjs?key=peerjs&id=a-n2VPDPv&token=ztytk6x3mde' failed: Error during WebSocket handshake: Unexpected response code: 404
What is the problem ?