Trying to create a game server but unable to connect to localhost 8081

Trying to create a game server but unable to connect to localhost 8081 - Asian guy in casual clothes using paper cup with thread as telephone while sitting on floor against white wall

I am trying to create a game server for the game 7 Days to Die but I am running into a problem. This is the file I was told to use when starting the server.

rem
rem Starts a dedicated server
rem
rem -quit, -batchmode, -nographics: Unity commands
rem -configfile           : Allows server settings to be set up in an xml config file. Use     no        path if in same dir or full path.
rem -dedicated                    : Has to be the last option to start the dedicated   server.

start 7DaysToDie -quit -batchmode -nographics -configfile=serverconfig.xml -dedicated

REM wait until game started
timeout 10

REM connect to the service interface. use 'shutdown' to stop the server
if exist "Tools/bin/putty.exe" (
 "Tools/bin/putty.exe" -telnet localhost 8081
    ) else (
     telnet localhost 8081
)

pause

I have looked online but no one seems to know the solution to the problem I am having. From what I understand I want to use the telnet protocol to connect to localhost on port 8081. I get the error "Could not open connection to the host, on port 8081". I have enabled the telnet client feature in windows 7. I also read online that I had to enable the telnet service in services.msc but I do not see the telnet service there. Why is the connection failing?



Best Answer

The default batch file is really poorly written, to start off with... if you're not familiar with telnet (or putty), or you don't want it, it's probably safe to comment that out and just use a manual client connection (ie. Put "REM" in front of each line, then fire up putty or your preferred telnet client if you want to connect to the control port).

For the most part, all the critical pieces are in your serverconfig.xml file. For example, the telnet configuation:

<property name="TelnetEnabled"  value="true"/>  <!-- Enable/Disable the telnet -->
<property name="TelnetPort"     value="8081"/>  <!-- Port of the telnet server -->
<property name="TelnetPassword" value="mypassword"/>    <!-- Password to gain entry to telnet interface -->

That just means you can generally use something like putty to login and issue administrative commands to the server (which is often nice). Note: you should sure sure to change the password before using the configuration.

Also, there's a component piece to it for your webbrowser... also in serverconfig.xml:

<property name="ControlPanelEnabled"    value="true"/>          <!-- Enable/Disable the control panel -->
<property name="ControlPanelPort"       value="8080"/>          <!-- Port of the control panel webpage -->
<property name="ControlPanelPassword"   value="mypassword"/>    <!-- Password to gain entry to the control panel -->

Again, change the password, but that will allow you to just connect a webbrowser to that port to monitor your server... something like http://localhost:8080/ should work (or replace localhost with your actual IP or hostname).




Pictures about "Trying to create a game server but unable to connect to localhost 8081"

Trying to create a game server but unable to connect to localhost 8081 - Girl sitting on grass and showing dirty hand
Trying to create a game server but unable to connect to localhost 8081 - From above of anonymous barefoot boy and girl in casual clothes sitting on floor carpet and playing with wooden blocks of jenga tower game
Trying to create a game server but unable to connect to localhost 8081 - Scrabble Tiles Forming Pinterest Word on Brown Wooden Surface



Why does localhost 8080 refused to connect?

$ kubectl get nodes The connection to the server localhost:8080 was refused - did you specify the right host or port? This is a common issue when you run the kubectl command or a similar command. In most cases, Kubernetes does not have the correct credentials to access the cluster.

Why is 127.0 0.1 refused to connect?

The default port number for the web server is 80. If you're trying to access it by typing localhost in your browser \u2013 which will direct to localhost:80 \u2013 but it turns out your web server is not configured to use the default port, you'll get the localhost error or 127.0 0.1 refused to connect message.

How do I connect to localhost 8080?

Hold down the Windows key and press the R key to open the Run dialog. Type \u201ccmd\u201d and click OK in the Run dialog. Verify the Command Prompt opens. Type \u201cnetstat -a -n -o | find "8080"".



Steam games not connecting to server error *FIX*




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Andrea Piacquadio, Charles Parker, Ketut Subiyanto, Pixabay