https://github.com/volatilflerovium/websocket_server
https://github.com/volatilflerovium/websocket_server
websocket websocket-server
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/volatilflerovium/websocket_server
- Owner: volatilflerovium
- License: unlicense
- Created: 2022-07-23T09:11:09.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T16:59:21.000Z (over 1 year ago)
- Last Synced: 2025-02-19T17:45:39.167Z (over 1 year ago)
- Topics: websocket, websocket-server
- Language: C++
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Websocket_server
## How to build it
```
mkdir build
cd build
cmake .. [-DBUILD_SHARED_LIBS=ON]
```
## Quick start
Example:
On the server side:
```
WebsocketServer server(some_ip, some_port);
MyServer.subscribeCommand("Cmd_1", [](const std::string& params){
// parse the parameter string
// do something with those values
// return the result to the client:
return theResult;
});
```
In your Javascript:
```
document.getElementById('ButtonCmd').addEventListener('click', function(){
var someData=getData();
MyWebsocket.sendMsg('Cmd_1:'+someData);
});
```
## COPYRIGHT
WebsocketServer is released into the public domain by the copyright holder.