mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-06-26 15:31:36 +02:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
b3efb316ed | |||
ea997cf977 | |||
a103bb915c | |||
bc58d75d71 | |||
d7be7cd2fe | |||
73faf7e6b6 | |||
00be8c7833 | |||
5b4eaa0b11 | |||
8988faf5f0 | |||
1ebae1d3e1 |
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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=*
|
||||
|
@ -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";
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user