migrate from localhost to shared hosting #1220
-
hi . peer server and peerjs client is working well on my localhost . i brought it on my shared hosting . now i have problem connecting to peer server after uploading it to my host . its 2 days im chaning options on both server and client side and got nothing . its my server address . when you click it its says peer server is working as it have to be . --------- my server code is : const express = require('express');
const fs = require("fs");
const app = express();
const { ExpressPeerServer } = require('peer');
const cors = require("cors");
app.use(cors());
const server2 = app.listen(9000);
const peerServer = ExpressPeerServer(server2, {
debug: true,
allow_discovery: true,
ssl: {
key: fs.readFileSync('./keyname.key'),
cert: fs.readFileSync('./cername.cer')
}
});
app.use("/peer-server",peerServer); ---------- and my client code is : const peer = new Peer(undefined,{
secure:true,
key:"peerjs",
host: "node2.bonyadonline.com",
port: "9000",
path: '/peer-server',
}); could you please help me . thanks |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 3 replies
-
It looks like you run nginx in front of the PeerJS server. There is probably a misconfiguration there, as the server code looks fine and it did work locally. Plus you need to remove the following line from the client config: port: "9000", |
Beta Was this translation helpful? Give feedback.
It looks like you run nginx in front of the PeerJS server. There is probably a misconfiguration there, as the server code looks fine and it did work locally.
Plus you need to remove the following line from the client config: