B4J Question Websocket - UpgradeRequest.RemoteAddress

LucaMs

Expert
Licensed User
Longtime User
Are you connecting to the server directly? Is there any proxy in the middle?
Directly (no local proxies).

But NOW I remember that the method worked.

Also, yesterday I helped someone to install XAMPP on his PC (not in my lan) and... I discovered that NOW I have some problem, an example web site on my pc is not reachable and when I try to access it, simply using a browser and HTTP://[MyRouterIP] /FolderSite... the "router administration home page" is shown!
I think this is a different problem, because the b4j websocket server is reachable on its port. Apache is as usual listening on ports 80 and 443 and I have disabled my firewalls (also the firewall of the router).

Ok, I will open a new thread for this, unless you do not think that the two things can be related.

The important thing is that the method works (worked here) so no problem with jServer.


Thank you


P.S. I wrote badly my question, moreover, because I should specify that the IP returned is not my pc (b4j server) IP but the router external IP.
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Also, yesterday I helped someone to install XAMPP on his PC (not in my lan) and... I discovered that NOW I have some problem, an example web site on my pc is not reachable and when I try to access it, simply using a browser and HTTP://[MyRouterIP] /FolderSite... the "router administration home page" is shown!
I think this is a different problem, because the b4j websocket server is reachable on his port. Apache is as usual listening on ports 80 and 443 and I have disabled my firewalls (also the firewall of the router).
Solved mapping port 80 to my pc (discouraged by the router) but, If I remember well (never :p) 2 years ago I had not need to do this.

I'm still getting the wan router IP instead of client IP (obviously, I should say, given that port 80 has nothing to do with the problem)
 
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Just tried logging into my app from my phone, and UpgradeRequest.RemoteAddress returns my phone IP.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
It does sound odd that you get the admin page when trying to access the router.
Wan access to router admin should always be turned off. (especially if you are using default password)

The router setup I've used in the past to allow a pc to host a multi user game were basically:

Internet > Router > DMZ > ip / port address of host computer on my network.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
One other thing to consider is - Does your ISP block port 80 for incoming connections to your router?
 
Upvote 0
Top