Closed Isma3ilMohamed closed 4 years ago
Your phone is firewalled and doesn't have a public IP.
Hey @stefan-reich thanks for reply but how to get public ip to phone and pass firewalled how can i achieve my purpose
I don't think you can, not directly.
You can use services like ngrok.io to serve web pages from your phone.
You can't do it directly. You would have to have a separate server in between to proxy the traffic to your phone.
Oh wait, I think ngrok has no app. http://serveo.net/ seems to have an Android app.
Here's some docs for that.
@stefan-reich @NoahAndrews thanks for your replies but about production app i still need to depend on Termux or BusyBox Are there other ways to do that?
I'll contact you
hey everyone i want to create remove server on my phone to can access it from anywhere so when i try local host everything work well but when try to connect to my public ip this error happened
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1453) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1565) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1453) Caused by: java.net.BindException: Cannot assign requested address at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:368) at java.net.ServerSocket.bind(ServerSocket.java:377) at java.net.ServerSocket.bind(ServerSocket.java:331) at fi.iki.elonen.NanoHTTPD$ServerRunnable.run(NanoHTTPD.java:1761) at java.lang.Thread.run(Thread.java:762)
and that is my Server Class
and that is Main Activity