Jump to content
  • Sign Up
  • 0
ToShuk.KR

Developing own server

Question

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

10 answers to this question

Recommended Posts

  • 0

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

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

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

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

Share this post


Link to post
  • 0

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...