asdlei99 / websocket_demo Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ac000/websocket_demo
A demo of WebSockets in C
License: MIT License
This project forked from ac000/websocket_demo
A demo of WebSockets in C
License: MIT License
This is a simple demonstration of WebSockets in C. It simply consists of a server and a HTML page. After it gets a connection, every two seconds (default) it will send the hostname, uptime and rx & tx bytes of the system running the server (can be the same as the client). Build the server (make), run it (non-root), then load the HTML page into a browser. You should then see a simple page showing the above information updating every two seconds. Change the interface to show stats for and adjust the frequency of updates using the 'spinner' widget. Really simple, just shows the basics of what's needed for two way communications. The WebSocket protocol is defined here: http://tools.ietf.org/html/rfc6455 It also demonstrates the use of epoll(7) to handle multiple connections in a single process. It will also make use of libseccomp (if installed) to constrain what system calls can be used once up and running. This really just serves as a demonstration. It also implements WebSockets over TLS (wss://), this can be enabled by passing 'tls' to the websocket_demo command. And by using wss://localhost:1976/ as the websocket connection string in websocket_demo.html You will also need a TLS certificate and key (can be self made, required some faffing about in Firefox to get it to work) and specify them in the the TLS_CERT & TLS_KEY variables in websocket_demo.c Licensed under the MIT license, see MIT-LICENSE.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.