0

I want to make a server using python, and the auto discover it using a web aplication.

I know i can make a python->python discovery using How to make a server discoverable to LAN clients from this thread. But i can't find a way to make the javascript discover that server.

It would be great if I could use the same connection, or at least the same port to make a socket server where i can send commands back and forth.

Any ideas?

Community
  • 1
  • 1
user6774435
  • 121
  • 1
  • 1
  • 7
  • Use a python web framework (Flask, Django) that will include a front-end, public area for javascript. – Caspar Wylie Aug 30 '16 at 13:17
  • Can this run in a offline html app. etc. emped it in a cordova app, or simply just run it by opening the index.html file? – user6774435 Aug 31 '16 at 06:15
  • It can run as a local web server - so yes - offline. It cannot run from a index.html page that's not quite how it works. Instead it serves the index.html file in a sense. You will need to take some time to configure it, then run the server from a console and visit it at localhost:8000. There is a lot of good documentation online, check out http://www.djangobook.com/ – Caspar Wylie Aug 31 '16 at 09:53
  • Sounds promising, thank you. – user6774435 Aug 31 '16 at 12:31
  • Please mark as answer then. Cheers! – Caspar Wylie Aug 31 '16 at 12:32
  • Turns out. It's not exactly what i want. I need to run from a html page, etc on a phone through cordova. Either that or the webapp should run from a server but the html page should still be able to find other websocket servers on its local wifi, even though the html file is loaded from an external server. – user6774435 Sep 01 '16 at 11:19

0 Answers0