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

Commit

Permalink
v2.11.1 to add sticky-session SIO
Browse files Browse the repository at this point in the history
### Release v2.11.1

1. Add option to use `transport=websocket` with sticky-session SIO server. Check [Run websocket only mode for Socket.IO #16](#16)
2. Add some Sticky_SIO-related examples
  • Loading branch information
khoih-prog authored Dec 12, 2021
1 parent 2952e55 commit 4df06e4
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 48 deletions.
156 changes: 127 additions & 29 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Release v2.11.1](#release-v2111)
* [Major Release v2.11.0](#major-release-v2110)
* [Release v2.10.1](#release-v2101)
* [Major Release v2.10.0](#major-release-v2100)
Expand Down Expand Up @@ -50,6 +51,11 @@

## Changelog

### Release v2.11.1

1. Add option to use `transport=websocket` with sticky-session SIO server. Check [Run websocket only mode for Socket.IO #16](https://github.com/khoih-prog/WebSockets_Generic/issues/16)
2. Add some Sticky_SIO-related examples

### Major Release v2.11.0

1. Auto detect ESP32 core to use for WT32_ETH01
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "WebSockets_Generic",
"version": "2.11.0",
"description": "RFC6455-based WebSockets Server and Client for Arduino boards, such as nRF52, Portenta_H7, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, RP2040-based boards, besides ESP8266/ESP32 and WT32_ETH01. Ethernet shields W5100, W5200, W5500, ENC28J60, Teensy 4.1 NativeEthernet/QNEthernet or Portenta_H7 WiFi/Ethernet",
"version": "2.11.1",
"description": "RFC6455-based WebSockets Server and Client for Arduino boards, such as nRF52, Portenta_H7, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, RP2040-based boards, besides ESP8266/ESP32 and WT32_ETH01. Ethernet shields W5100, W5200, W5500, ENC28J60, Teensy 4.1 NativeEthernet/QNEthernet or Portenta_H7 WiFi/Ethernet. Now supporting websocket only mode for Socket.IO",
"keywords": "wifi, WiFiNINA, websocket, websockets-server, websockets-client, Teensy, SAM DUE, SAMD, STM32, nRF52, QNEthernet, rp2040, Portenta-H7, ESP32, ESP8266, W5x00, Ethernet, Ethernet2, Ethernet3, EthernetLarge, EthernetENC, UIPEthernet, NativeEthernet, ENC28J60, rpi-pico, http, web, server, client, Mega",
"authors": [
{
Expand Down Expand Up @@ -81,7 +81,7 @@
{
"owner": "khoih-prog",
"name": "SinricPro_Generic",
"version": ">=2.8.3",
"version": ">=2.8.4",
"platforms": ["*"]
},
{
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name=WebSockets_Generic
version=2.11.0
version=2.11.1
author=Markus Sattler, Khoi Hoang <[email protected]>
maintainer=Khoi Hoang <[email protected]>
sentence=RFC6455-based WebSockets Server and Client for Arduino boards, such as nRF52, Portenta_H7, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, RP2040-based boards, besides ESP8266/ESP32 and WT32_ETH01. Ethernet shields W5100, W5200, W5500, ENC28J60, Teensy 4.1 NativeEthernet/QNEthernet or Portenta_H7 WiFi/Ethernet.
sentence=RFC6455-based WebSockets Server and Client for Arduino boards, such as nRF52, Portenta_H7, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, RP2040-based boards, besides ESP8266/ESP32 and WT32_ETH01. Ethernet shields W5100, W5200, W5500, ENC28J60, Teensy 4.1 NativeEthernet/QNEthernet or Portenta_H7 WiFi/Ethernet. Now supporting websocket only mode for Socket.IO
paragraph=Use v2.2.2+ for ESP, nRF52, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, RP2040-based boards, WT32_ETH01, Portenta_H7, etc.
category=Communication
url=https://github.com/khoih-prog/WebSockets_Generic
Expand Down
4 changes: 2 additions & 2 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ lib_deps =
STM32duino LwIP@>=2.1.2
STM32duino STM32Ethernet@>=1.2.0
DoubleResetDetector_Generic@>=1.7.3
SinricPro_Generic@>=2.8.3
SinricPro_Generic@>=2.8.4
FlashStorage_SAMD@>=1.2.1
FlashStorage_STM32@~1.1.0
https://github.com/ssilverman/QNEthernet
Expand All @@ -74,7 +74,7 @@ lib_deps =
; stm32duino/STM32duino LwIP@>=2.1.2
; stm32duino/STM32duino STM32Ethernet@>=1.2.0
; khoih-prog/DoubleResetDetector_Generic@>=1.7.3
; khoih-prog/SinricPro_Generic@>=2.8.3
; khoih-prog/SinricPro_Generic@>=2.8.4
; khoih-prog/FlashStorage_SAMD@~1.2.1
; khoih-prog/FlashStorage_STM32@~1.1.0
; https://github.com/ssilverman/QNEthernet
Expand Down
3 changes: 2 additions & 1 deletion src/SocketIOclient_Generic-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
7 changes: 6 additions & 1 deletion src/SocketIOclient_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,13 +54,18 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once

#ifndef SOCKET_IO_CLIENT_GENERIC_H_
#define SOCKET_IO_CLIENT_GENERIC_H_

#if !defined(USING_STICKY_SESSION_SIO)
#define USING_STICKY_SESSION_SIO false
#endif

#include "WebSockets_Generic.h"

#define EIO_HEARTBEAT_INTERVAL 20000
Expand Down
3 changes: 2 additions & 1 deletion src/WebSockets4WebServer_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
8 changes: 7 additions & 1 deletion src/WebSocketsClient_Generic-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down Expand Up @@ -889,7 +890,12 @@ void WebSocketsClient::sendHeader(WSclient_t * client)
{
if (client->cSessionId.length() == 0)
{
#if USING_STICKY_SESSION_SIO
#warning Using USING_STICKY_SESSION_SIO with transport=websocket
url += WEBSOCKETS_STRING("&transport=websocket");
#else
url += WEBSOCKETS_STRING("&transport=polling");
#endif
ws_header = false;
}
else
Expand Down
3 changes: 2 additions & 1 deletion src/WebSocketsClient_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/WebSocketsDebug_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -50,6 +50,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/WebSocketsServer_Generic-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/WebSocketsServer_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/WebSocketsVersion_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/WebSockets_Generic-Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,6 +54,7 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once
Expand Down
5 changes: 3 additions & 2 deletions src/WebSockets_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2.11.0
Version: 2.11.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -54,14 +54,15 @@
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
*****************************************************************************************************************************/

#pragma once

#ifndef WEBSOCKETS_GENERIC_H_
#define WEBSOCKETS_GENERIC_H_

#define WEBSOCKETS_GENERIC_VERSION "WebSockets_Generic v2.11.0"
#define WEBSOCKETS_GENERIC_VERSION "WebSockets_Generic v2.11.1"

#include "WebSocketsDebug_Generic.h"

Expand Down

0 comments on commit 4df06e4

Please sign in to comment.