I have been installing and setting up a new public server behind my router as a test.
Server is running on an 18.0.4 ubuntu laptop and I've been testing with my PC
Xmage Server version is 1.4.48-V2
Things I have done:
1) Downloaded and unzip the latest install zip file
2) Modified the mage-server/config/config.xml file to have: <server serverAddress="myxmage.ddns.net" (instead of <server serverAddress="0.0.0.0")
3) Setup a ddns entry to have myxmage.ddns.net pointing to MY_EXTERNAL_IP
4) Added 0.0.0.0<tab>myxmage.ddns.net to /etc/hosts
- Code: Select all
4b) Also tried in /etc/hosts the following: (note, none of these worked - re-ran mage-server/startServer.sh after each modification):
LAPTOP_INTERNAL_IP<tab>myxmage.ddns.net
0.0.0.0<tab>MY_EXTERNAL_IP
LAPTOP_INTERNAL_IP<tab>MY_EXTERNAL_IP
5) Setup a mobile hotspot on my phone and connected PC's wifi connection through this so it would be connecting from outside of any internal network shenanigans
6) Port forwarded 17171 and 17172 through my router (192.168.1.1 in my case)
7) Checked the DNS setup with
http://myxmage.ddns.net/17171 and
http://myxmage.ddns.net/17172 from my PC with dummy perl web servers running on my laptop bound to those two ports (this worked fine)
eight) Ran wireshark to see what was happening from the PC's end. (could see the jboss... stuff so knew the client and server were communicating)
9) Modified the startServer.sh script to use a java 8 version.
10) Debugged the client on the PC side.
It would get to the following lines of code:
mage\Mage.Common\src\main\java\mage\remote\SessionImpl.java
- Code: Select all
callbackClient.addListener(callbackHandler, callbackMetadata); <<callbackMetadata only had one entry on this line
// Would die in between here
Set callbackConnectors = callbackClient.getCallbackConnectors(callbackHandler);<<callbackMetadata had four entries on this line for connecting to say xmage.de
I was kind of running out of things to try and/or setup at this stage so started writing this.
I went back to the config.xml and realised the secondaryBindPort was still set to '-1'
I changed this as per the following:
- Code: Select all
<server serverAddress="myxmage.ddns.net"
serverName="bobbobberson"
port="17171"
secondaryBindPort="17172"
And success after a restart of the server!
Able to connect on to it from my PC's client (with the PC coming in from a completely external IP as it was connected to my phone's mobile hotspot).
It was painful but hopefully this is helpful to someone setting up another public server behind a NAT firewall/router.