Compare commits

..

10 Commits
2.0.1 ... 2.0.2

Author SHA1 Message Date
b3efb316ed bump version 2016-03-16 16:25:57 +01:00
ea997cf977 update README.md 2016-03-16 16:25:31 +01:00
a103bb915c Merge remote-tracking branch 'remotes/origin/async' 2016-03-16 16:23:50 +01:00
bc58d75d71 Merge pull request #59 from uncletammy/patch-1
Added note about delay() limitation.
2016-03-16 16:23:26 +01:00
d7be7cd2fe Merge pull request #64 from urish/patch-1
fix typo: lenght -> length
2016-03-16 15:55:00 +01:00
73faf7e6b6 Merge pull request #65 from urish/patch-2
Make the `Sec-WebSocket-Protocol` header optional
2016-03-16 15:54:26 +01:00
00be8c7833 Make the Sec-WebSocket-Protocol header optional
Some server implementations (e.g. slack bots api) don't accept the connection if `Sec-WebSocket-Protocol` is specified.
2016-03-16 11:55:21 +02:00
5b4eaa0b11 fix typo: lenght -> length 2016-03-16 03:28:21 +02:00
8988faf5f0 fix #60
os_printf can not handle String direct
2016-03-05 12:13:13 +01:00
1ebae1d3e1 Add note about delay() limitation.
Change concerns issue https://github.com/Links2004/arduinoWebSockets/issues/58
2016-03-04 14:19:19 -06:00
5 changed files with 16 additions and 11 deletions

View File

@ -18,7 +18,11 @@ a WebSocket Server and Client for Arduino based on RFC6455.
- max input length is limited to the ram size and the ```WEBSOCKETS_MAX_DATA_SIZE``` define
- max output length has no limit (the hardware is the limit)
- Client send big frames with mask 0x00000000 (on AVR all frames)
##### Limitations for Async #####
- Functions called from within the context of the websocket event might not honor `yield()` and/or `delay()`. See [this issue](https://github.com/Links2004/arduinoWebSockets/issues/58#issuecomment-192376395) for more info and a potential workaround.
- wss / SSL is not possible.
##### Supported Hardware #####
- ESP8266 [Arduino for ESP8266](https://github.com/Links2004/Arduino)
- ESP31B
@ -45,8 +49,6 @@ The mode can be aktivated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE
[ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP) libary is required.
Note: in this mode wss / SSL is not possible.
### Issues ###
Submit issues to: https://github.com/Links2004/arduinoWebSockets/issues

View File

@ -22,7 +22,7 @@ WebSocketsClient webSocket;
#define USE_SERIAL Serial1
void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
switch(type) {
@ -44,11 +44,11 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t lenght) {
// webSocket.sendTXT("message here");
break;
case WStype_BIN:
USE_SERIAL.printf("[WSc] get binary lenght: %u\n", lenght);
hexdump(payload, lenght);
USE_SERIAL.printf("[WSc] get binary length: %u\n", length);
hexdump(payload, length);
// send data to server
// webSocket.sendBIN(payload, lenght);
// webSocket.sendBIN(payload, length);
break;
}

View File

@ -1,9 +1,9 @@
name=WebSockets
version=2.0
version=2.0.2
author=Markus Sattler
maintainer=Markus Sattler
sentence=WebSockets for Arduino (Server + Client)
paragraph=use 2.0 for ESP and 1.3 for AVR
paragraph=use 2.x.x for ESP and 1.3 for AVR
category=Communication
url=https://github.com/Links2004/arduinoWebSockets
architectures=*

View File

@ -397,9 +397,12 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
"Connection: Upgrade\r\n"
"User-Agent: arduino-WebSocket-Client\r\n"
"Sec-WebSocket-Version: 13\r\n"
"Sec-WebSocket-Protocol: " + client->cProtocol +"\r\n"
"Sec-WebSocket-Key: " + client->cKey + "\r\n";
if(client->cProtocol.length() > 0) {
handshake += "Sec-WebSocket-Protocol: " + client->cProtocol + "\r\n";
}
if(client->cExtensions.length() > 0) {
handshake += "Sec-WebSocket-Extensions: " + client->cExtensions + "\r\n";
}

View File

@ -627,7 +627,7 @@ void WebSocketsServer::handleHeader(WSclient_t * client, String * headerLine) {
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] - cProtocol: %s\n", client->num, client->cProtocol.c_str());
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] - cExtensions: %s\n", client->num, client->cExtensions.c_str());
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] - cVersion: %d\n", client->num, client->cVersion);
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] - base64Authorization: %s\n", client->num, client->base64Authorization);
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] - base64Authorization: %s\n", client->num, client->base64Authorization.c_str());
bool ok = (client->cIsUpgrade && client->cIsWebsocket);