-
Notifications
You must be signed in to change notification settings - Fork 23
Hosting Your Own Server
Replit is a free online coding environment that allows you to host your game project for free. Follow the steps below to self-host your game project on Replit:
-
Clone this repo.
-
Import the cloned repository into Replit.
-
Open the console in Replit and run the following command to clone the repository into the
public
folder:
git clone https://github.com/SurvivReloaded/survivreloaded-client.git public
-
Run the Replit project. This will install any necessary dependencies.
-
Run
npm dev
to preview any changes. -
Open the
config.json
file and change thehost
from127.0.0.1
to0.0.0.0
. This is necessary to allow Replit to generate a domain for your project and open a webview tab with it. -
You should now see that the game website is online, but when starting the game it will fail to connect to the WebSocket server. To fix this, add a value
webSocketAddress
toconfig.json
, with the URL generated by Replit, without thehttps://
prefix. Example:
"webSocketAddress": "survivreloaded-server.replitusername.repl.co:8001",
With these steps, your game project should now be hosted and available online for others to play.