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

Commit 4df06e4

Browse files
authored
v2.11.1 to add sticky-session SIO
### 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
1 parent 2952e55 commit 4df06e4

16 files changed

+172
-48
lines changed

README.md

Lines changed: 127 additions & 29 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Release v2.11.1](#release-v2111)
1516
* [Major Release v2.11.0](#major-release-v2110)
1617
* [Release v2.10.1](#release-v2101)
1718
* [Major Release v2.10.0](#major-release-v2100)
@@ -50,6 +51,11 @@
5051

5152
## Changelog
5253

54+
### Release v2.11.1
55+
56+
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)
57+
2. Add some Sticky_SIO-related examples
58+
5359
### Major Release v2.11.0
5460

5561
1. Auto detect ESP32 core to use for WT32_ETH01

library.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "WebSockets_Generic",
3-
"version": "2.11.0",
4-
"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",
3+
"version": "2.11.1",
4+
"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",
55
"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",
66
"authors": [
77
{
@@ -81,7 +81,7 @@
8181
{
8282
"owner": "khoih-prog",
8383
"name": "SinricPro_Generic",
84-
"version": ">=2.8.3",
84+
"version": ">=2.8.4",
8585
"platforms": ["*"]
8686
},
8787
{

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name=WebSockets_Generic
2-
version=2.11.0
2+
version=2.11.1
33
author=Markus Sattler, Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
5-
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.
5+
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
66
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.
77
category=Communication
88
url=https://github.com/khoih-prog/WebSockets_Generic

platformio/platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ lib_deps =
5454
STM32duino LwIP@>=2.1.2
5555
STM32duino STM32Ethernet@>=1.2.0
5656
DoubleResetDetector_Generic@>=1.7.3
57-
SinricPro_Generic@>=2.8.3
57+
SinricPro_Generic@>=2.8.4
5858
FlashStorage_SAMD@>=1.2.1
5959
FlashStorage_STM32@~1.1.0
6060
https://github.com/ssilverman/QNEthernet
@@ -74,7 +74,7 @@ lib_deps =
7474
; stm32duino/STM32duino LwIP@>=2.1.2
7575
; stm32duino/STM32duino STM32Ethernet@>=1.2.0
7676
; khoih-prog/DoubleResetDetector_Generic@>=1.7.3
77-
; khoih-prog/SinricPro_Generic@>=2.8.3
77+
; khoih-prog/SinricPro_Generic@>=2.8.4
7878
; khoih-prog/FlashStorage_SAMD@~1.2.1
7979
; khoih-prog/FlashStorage_STM32@~1.1.0
8080
; https://github.com/ssilverman/QNEthernet

src/SocketIOclient_Generic-Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
License along with this library; if not, write to the Free Software
2929
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3030
31-
Version: 2.11.0
31+
Version: 2.11.1
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -54,6 +54,7 @@
5454
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
5555
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
5656
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
57+
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
5758
*****************************************************************************************************************************/
5859

5960
#pragma once

src/SocketIOclient_Generic.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
License along with this library; if not, write to the Free Software
2929
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3030
31-
Version: 2.11.0
31+
Version: 2.11.1
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -54,13 +54,18 @@
5454
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
5555
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
5656
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
57+
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
5758
*****************************************************************************************************************************/
5859

5960
#pragma once
6061

6162
#ifndef SOCKET_IO_CLIENT_GENERIC_H_
6263
#define SOCKET_IO_CLIENT_GENERIC_H_
6364

65+
#if !defined(USING_STICKY_SESSION_SIO)
66+
#define USING_STICKY_SESSION_SIO false
67+
#endif
68+
6469
#include "WebSockets_Generic.h"
6570

6671
#define EIO_HEARTBEAT_INTERVAL 20000

src/WebSockets4WebServer_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
License along with this library; if not, write to the Free Software
2929
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3030
31-
Version: 2.11.0
31+
Version: 2.11.1
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -54,6 +54,7 @@
5454
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
5555
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
5656
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
57+
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
5758
*****************************************************************************************************************************/
5859

5960
#pragma once

src/WebSocketsClient_Generic-Impl.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
License along with this library; if not, write to the Free Software
2929
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3030
31-
Version: 2.11.0
31+
Version: 2.11.1
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -54,6 +54,7 @@
5454
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
5555
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
5656
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
57+
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
5758
*****************************************************************************************************************************/
5859

5960
#pragma once
@@ -889,7 +890,12 @@ void WebSocketsClient::sendHeader(WSclient_t * client)
889890
{
890891
if (client->cSessionId.length() == 0)
891892
{
893+
#if USING_STICKY_SESSION_SIO
894+
#warning Using USING_STICKY_SESSION_SIO with transport=websocket
895+
url += WEBSOCKETS_STRING("&transport=websocket");
896+
#else
892897
url += WEBSOCKETS_STRING("&transport=polling");
898+
#endif
893899
ws_header = false;
894900
}
895901
else

src/WebSocketsClient_Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
License along with this library; if not, write to the Free Software
2929
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3030
31-
Version: 2.11.0
31+
Version: 2.11.1
3232
3333
Version Modified By Date Comments
3434
------- ----------- ---------- -----------
@@ -54,6 +54,7 @@
5454
2.10.0 K Hoang 18/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
5555
2.10.1 K Hoang 12/10/2021 Update `platform.ini` and `library.json`
5656
2.11.0 K Hoang 30/11/2021 Auto detect ESP32 core version. Fix bug in examples
57+
2.11.1 K Hoang 12/12/2021 Add option to use transport=websocket with sticky-session SIO server
5758
*****************************************************************************************************************************/
5859

5960
#pragma once

0 commit comments

Comments
 (0)