Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Arduino websocket server for the Door Controller Test Tool. (THIS PROJECT IS NO LONGER MAINTAINED)

Notifications You must be signed in to change notification settings

AxisCommunications/arduino-websocket-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

END-OF-LIFE NOTICE

Axis Communications is no longer maintaining this project.

Arduino Websocket Server for Door Controller Test Tool

This library implements a Websocket server running on an Arduino. It's based on the proposed standard published December 2011 which is supported in the current versions (January 2014) of Firefox, Chrome, and Safari.

The library is used by the Door Controller Test Tool.

Limitations

The implementation in this library has restrictions as the Arduino platform resources are very limited:

  • The server only handles TXT frames.
  • The server only handles single byte chars. The Arduino just can't handle UTF-8 to it's full.
  • The server only accepts final frames with maximum payload length of 256 bytes. No fragmented data, in other words.
  • For now, the server silently ignores all frames except TXT, CLOSE and PONG.
  • The server only handles one client at a time.

Required headers (example):

GET /whatever HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http:https://example.com
Sec-WebSocket-Version: 13

The server checks that all of these headers are present, but only cares that the version is 13 and origin is not null.

Response example:

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=

The last line is the Base64 encoded SHA-1 hash of the key with a concatenated GUID, as specified by the standard.

Requirements

  • Arduino IDE 1.0.1 or greater. You should not use 1.0 since it has a bug in the Ethernet library that will affect this library.
  • An Arduino Duemilanove or greater with Ethernet shield. An Arduino Ethernet should work too, but it has not been tested.
  • A Websocket client that conforms to version 13 of the protocol.

About

Arduino websocket server for the Door Controller Test Tool. (THIS PROJECT IS NO LONGER MAINTAINED)

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 91.2%
  • C 8.8%