cyring / WebSocket

A WebSocket template in C language based on the WebSockets library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebSocket

Purpose

This is an example of a WebSocket server written in C using the libwebsockets library. Every second, the server pushes the Linux system information toward the Javascript clients. Any client can suspend the server activity whom state is broadcasted to other clients. A rudimentary JSON composes the bidirectional message protocol.

Build

Just enter make or rebuild as below

make clean all

Run

1- Execute the server

./bin/WebSocket [port]

2- Open a browser and point to the server url with a given hostname:port

http://localhost:8080

3- You can also start the client script with the browser shortcut [CTRL]+[O]

WebClient.html

Enjoy

CyrIng

Paris ;-)

About

A WebSocket template in C language based on the WebSockets library.


Languages

Language:C 56.6%Language:HTML 20.6%Language:JavaScript 13.4%Language:CSS 5.4%Language:Makefile 4.0%