Jump to content

Developing own server

Posted

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!

Featured Replies

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 

Owner and founder of Good old Lava Survival, MCGalaxy plugin developer, Master of evil hacks not supported by UnknownShadow.

No, the packets are still TCP. The difference is that the data for the classic protocol is wrapped in the WebSocket header.

Owner and founder of Good old Lava Survival, MCGalaxy plugin developer, Master of evil hacks not supported by UnknownShadow.

  • Author

so, communication between server and web client must be via ws headers ? datas sent via ws headers i mean 

Not through headers but using the WebSocket specification to send compatible WebSockets

Owner and founder of Good old Lava Survival, MCGalaxy plugin developer, Master of evil hacks not supported by UnknownShadow.

  • Author

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 by ToShuk.KR

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

  • Author
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 

READ THE RULES BEFORE YOU POST

Create an account or sign in to comment