dpallot / simple-websocket-server

A python based websocket server that is simple and easy to use.
951 stars 319 forks source link

How to add extra path to websocket url? #78

Closed easymavinmind closed 5 years ago

easymavinmind commented 6 years ago

In the example, we can configure our desired port in (such as 8000 or something else) SimpleWebSocketServer('', 8000, SimpleChat)

can we configure the extra path so our client accessing something like ws://localhost:8000/test" ?

uzlonewolf commented 6 years ago

Already does, in your handleConnected() the "/test" is available in self.request.path . If you want to reject the connection if the wrong path is given just have handleConnected() call close(), or clear self.sendq and build the reject response yourself.