How do I make a P2P server on repl.it?
Hey! I'm trying to implement 2-player multiplayer in my game, and I'm using PeerJS for Peer-To-Peer Connection. I've got everything working, except making the server. For now, just to test, I'm using the default server that my game engine offers, but I want to make my own. I'm aware of how I can make a server on my computer (peerjs --port <insert port here> --key peerjs --path /myapp
), but that won't stay on 24/7. Could someone help? Thanks!
You don't need a peer server and im not sure if it even works since replit only supports TCP/IP servers on port 80. It will automatically connect to peerJS free server if you only don't specify a server: https://peerjs.com/peerserver.html
"what" will automatically connect to a PeerJS free server @behavingEffort?
The port should be 8.0.8.0
.
@JosephSanthosh, what are you talking about?
Before you edited your description of problem above, the port was wrong, the correct one is 8.0.8.0
if you're using repl.it! @GoldenFox5313
Oh. I copy/pasted it from PeerJS' page, and I realised just now! @JosephSanthosh. But how am I supposed to do it?
@GoldenFox5313 I do python not js, not yet at least. I'm so sorry, maybe @abhaybhat can help you.
Sry I meant @EpicGamer007, could you help @GoldenFox5313 with this issue?
Alright, @JosephSanthosh. Thanks!
@JosephSanthosh Bruh 8.0.8.0 is not a port, that's an IP, and that's the wrong IP.
@GoldenFox5313 , ok, tbh i am really bad at js, but i will give you my idea. If you want to keep a server running, make it a web server and ping it.. i dont think i can help much with this sorry :(
Ok, I will try that. Thanks! @EpicGamer007
@GoldenFox5313 , i suggest waiting a bit more and asking more people on the repl discord, I am not someone who can help very well. If you want I can post it for you
Ok, I'll definitely check that out @EpicGamer007. I just got an idea from what you said earlier, so I'm trying it out right now.
@JosephSanthosh i think you mean the port 8080
Hello, did you solve that problem? Can you please help me too?