0

So I am trying to create a server in an android application onto a remote URI and tried to do this using the createWebServer(), but it seems like this doesn't work because I cannot access the address on my computer.

server = WebServers.createWebServer(Executors.newCachedThreadPool(), new InetSocketAddress(HOSTNAME,PORT), URI.create(HOSTNAME + ":" + PORT));

Does anyone know how to do this using Webbit?

Pozzo Apps
  • 1,859
  • 2
  • 22
  • 32
jalapenolime
  • 217
  • 3
  • 15
  • can you access the server from the phone itself? – Axarydax Jul 17 '13 at 18:02
  • I'm not quite sure how to check that since my app doesn't browse the internet after creating the server. But when I create a localhost server I must forward the tcp port using adb to access it from my PC browser. So I am wondering if webbit is just not capable of creating a remote server? I have tried using nanohttpd and it does this task fine but I would like to do this using Webbit – jalapenolime Jul 17 '13 at 18:12
  • well you could try to issue a HTTP GET request to the web server you have just created in the app, and if it works, you'll know that the problem lies elsewhere – Axarydax Jul 17 '13 at 18:15
  • Yeah it doesn't seem to work – jalapenolime Jul 17 '13 at 18:37

0 Answers0