Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.14 KB

README.md

File metadata and controls

49 lines (39 loc) · 1.14 KB

Websocket Client implementation

Simple Websocket Client using mbedtls tested on STM32F7

Features

  • Sending and Receiving encrypted websocket data

Limitations

  • No continuation frames
  • Not parsing Server Handshake response
  • No other Op Codes than "text"
  • No random Nonce for handshake

Prerequisites

Set up a Project for your STM32 Microcontroller with LWip and mbedTLS For example:

Also you need:

  • openssl
  • golang (for the test websocket server)

Usage

  1. Adjust the client.h
  2. In your main.c
#include client.h

and call

SSL_Client();

Somewhere in you main();

  1. Generate Cert/Key and build and start server
mkdir -p $GOPATH/src/github.com/anon767/wsserver
cp ./test_server.go $GOPATH/src/github.com/anon767/wsserver/wsserver.go
cd $GOPATH/src/github.com/anon767/wsserver
go get && go build
chmod +x wsserver
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
./wsserver
  1. Compile and Flash your device