Skip to content

Latest commit

 

History

History
executable file
·
31 lines (21 loc) · 1.18 KB

README.md

File metadata and controls

executable file
·
31 lines (21 loc) · 1.18 KB

httpwebsockethandler

Python combines HTTP and WebSocketServer with SSL support

In my plugwise-2-py repository a python3 version can be found.

##command line options

#assume ExampleWSServer.py and HTTPWebSocketsHandler.py are in the current directory
nohup python ExampleWSServer.py 8000 secure username:mysecret >>ws.log&

This uses SSL/https. Change username:mysecret in a username:password chosen by yourself. The websserver uses port 8000 by default, and can be changed by an optional parameter:

nohup python ExampleWSServer.py 8001 secure username:mysecret >>ws.log&

Providing a user:password is optional, as well as using SSL/https. When the website is only accessible within your LAN, then the server can be used as plain http, by omitting the secure parameter. The following parameter formats are valid:

nohup python ExampleWSServer.py 8001 secure user:password >>ws.log&

#no username and password requested
nohup python ExampleWSServer.py 8000 secure >>ws.log&

#plain http, with optional port
nohup python ExampleWSServer.py 8002 >>ws.log&

#plain http, default port 8000
nohup python ExampleWSServer.py >>ws.log&