ToShuk.KR Posted September 20 this is my GOAL to create a server on python working on websockets (for web client). So, please, who can share a documentation with me ? or can give some helpful links ? Thank you community! Share this post Link to post
0 icanttellyou Posted September 20 WebSockets just wrap the protocol communication through HTTP-like headers. You may need to implement WSS proxy support, and there isn’t really documentation for that An easy way to probe for HTTP/WebSockets is to check if the first byte of the packet starts with G, and if it does then transition to using a WebSocket handler to then read/write data as usual Share this post Link to post
0 ToShuk.KR Posted September 20 got it, so i need to create TCP to WS bridge ? Share this post Link to post
0 icanttellyou Posted September 20 No, the packets are still TCP. The difference is that the data for the classic protocol is wrapped in the WebSocket header. Share this post Link to post
0 ToShuk.KR Posted September 20 so, communication between server and web client must be via ws headers ? datas sent via ws headers i mean Share this post Link to post
0 icanttellyou Posted September 20 Not through headers but using the WebSocket specification to send compatible WebSockets Share this post Link to post
0 ToShuk.KR Posted September 20 Okay, maybe there is some examples ? somewhere ? Share this post Link to post
0 ToShuk.KR Posted September 20 (edited) Hard to understand without examples 🙂 It will be great to get some examples in python , but i not sure that we have such example Not Sure, but i got this Quote GET / HTTP/1.1 Host: 127.0.0.1:8888 Connection: Upgrade Pragma: no-cache Cache-Control: no-cache User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Upgrade: websocket Origin: http://127.0.0.1 Sec-WebSocket-Version: 13 Accept-Encoding: gzip, deflate, br, zstd Accept-Language: en-US,en;q=0.9,ru;q=0.8,pt;q=0.7,uk;q=0.6 Cookie: connect.sid=s%3AEN_sR4WVGueHOM6GHwdyQ9sHx6L36mNd.NPLkUHBqd%2BG28RdSi9VOAHo5zK9WkiQfNhSL5tAQtOY Sec-WebSocket-Key: bXuMQw56Svbcw4ZSaehGeA== Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits Sec-WebSocket-Protocol: ClassiCube Edited September 20 by ToShuk.KR Share this post Link to post
0 morgana Posted September 20 While I have not cared for looking at the source code this appears to be a semi-popular (relatively) python based classicube server from which you can look for examples, I have joined a few servers running this before. https://github.com/EdwardJXLi/ProjectObsidian Share this post Link to post
0 ToShuk.KR Posted September 20 1 hour ago, morgana said: While I have not cared for looking at the source code this appears to be a semi-popular (relatively) python based classicube server from which you can look for examples, I have joined a few servers running this before. https://github.com/EdwardJXLi/ProjectObsidian Thanks, but this server looks like without ws Share this post Link to post
this is my GOAL to create a server on python working on websockets (for web client). So, please, who can share a documentation with me ? or can give some helpful links ?
Thank you community!
Share this post
Link to post