Atjeews
Atjeews copied to clipboard
Cant access server from local network or via IP
Hi,
Great work. I am trying to get the server running on my android device and then later build upon it. I can deploy the app to Android and localhost:8080 works fine from the Android device, but accessing via 192.168.X.X both on the device and via a PC on the same Wifi network times out. What am I missing?
Request came from me over Play Store. Silly me - fixed the issue.
Just enable Server and deploy the settings servlet. Go to your localhost:8080/settings and change Binding addr to your local network address. (Should be shown in dropdown list) Afterwards disable and re-enable the server in the app. Should now be bound to the new addr and accessible from everywhere.
May raise the issue here: Would be cool if it'd be possible to change the Bind addr from the App instead of the settings.
Thanks for your great work!
You are welcome. Generally I can't solve the problem gracefully yet, since there is a wide range of Android devices on different networks and auto detection of a proper network configuration isn't obvious. Could you elaborate more of your requirement, I am pretty sure it is easy to satisfy?
Some android phones have a NetworkInterface with name "name:nunber%dummy0", use adb shell ifconfig, Got
[user@localhost platform-tools]$ ./adb shell
SS2:/ $ ifconfig
lo Link encap:UNSPEC
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 TX bytes:0
dummy0 Link encap:UNSPEC
inet6 addr: fe88::5332:6eef:fe87:f0a8/64 Scope: Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:350
wlan0 Link encap:UNSPEC Driver icnss
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:0 TX bytes:0
rmnet_data0 Link encap:UNSPEC
inet6 addr: fe80::46a9:de2e:3b47:c009/64 Scope: Link
UP RUNNING MTU:2000 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17154 TX bytes:1204
rmnet_ipa0 Link encap:UNSPEC
UP RUNNING MTU:2000 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17562 TX bytes:1204
p2p0 Link encap:UNSPEC Driver icnss
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:0 TX bytes:0
SS2:/ $
when bind to dummy0(it before localhost), don't know how to connect it.