Skip to content

jo-jordan/websocket_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket Server

Implements according to RFC6455.

Quick start

Build

git clone https://github.com/lzjlxebr/websocket_server.git
cd ./websocket_server
mkdir build && cd $_
cmake .. -DCMAKE_C_COMPILER=gcc
make

Run server

./websocket_server

Run client in a browser

// Make a WebSocket client
let ws = new WebSocket('ws://127.0.0.1:9000/')

// Make client listen for message
ws.onmessage = (e) => { console.log('message:', e.data) }
ws.onclose = (e) => { console.log('message:', e) }

// Send message to server
ws.send('hello')

// Close conncetion
ws.close()

TODO List

  • Handshake opening
  • Handshake closing
  • Receiving data from client
    • Unmask single frame payload
    • Unmask multiple frames payload
    • Ping & Pong
  • Sending data to client
  • All platform supported
    • Linux
    • Darwin
    • Windows
  • Using Event loop with Reactor pattern
    • Multiple process for now
    • Using system call poll
    • Event loop
  • RFC6455 validations
  • Security stuff
  • Considering distributed situation

About

A websocket server implement by c

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published