Android Question jRDC2 home server switching between wifi to internet (home ip)

yfleury

Active Member
Licensed User
Hi! All
I have a jrdc2 server at home. On my wifi, I use this this code to connect my app to jrdc2 server.
B4X:
Private const rdcLink As String = "http://192.168.0.6:17178/rdc"
Is it a way to switch automatically from my wifi ip to internet ip (my home) when I am outside.

I open port on my router and I can reach my jrdc2 server when I change ip address manually
 

OliverA

Expert
Licensed User
Always use the outside IP address even if you are on your WiFi?
 

yfleury

Active Member
Licensed User
Always use the outside IP address even if you are on your WiFi?
When I am at home, I can't access my home server by internet when I use wifi.

You can test your Android device LocalIP with
B4X:
ServerSocket.GetMyIp
If you get that this localIP is a private IP, switch to rdclink private IP; otherwise, use públic rdclink
I will try that

Thank all
 

yfleury

Active Member
Licensed User
On wifi I have this in log
B4X:
leserveur.GetMyIP 192.168.1.147
leserveur.GetMyWifiIP 192.168.1.147
On mobile internet I have this in log
B4X:
leserveur.GetMyIP fe80::347b:caff:febb:203e%dummy0
leserveur.GetMyWifiIP 127.0.0.1
fe80::347b:caff:febb:203e is it an ipv6?
 
Top