Skip to content

mcferront/simple_websocket

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Simple websocket server in C++

I couldn't find public implementation of a websocket server in C++, so I spent a few hours figuring it out and writing it. I'm posting it in hopes it saves someone else time in figuring it out.

What it is:

  • Winsock server created to listen for a single connection
  • A websocket is then established and the server echos back the client's text

What it is not:

  • Robust or meant for anything other than a basic understanding of a C/C++ websocket implementation

How to use it:

  • Compile and run Server/websockets.sln
  • Open Client/socket_test.html in a browser

The client will send a string to the server, the server will echo it back and the client will print the response via console.log

About

Simple websocket server in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published