Compare commits

..

5 Commits

Author SHA1 Message Date
1789a18ddb Update README.md (#927)
* Update README.md

Updating README to include ESP32 support in client mode

* Update README.md

---------

Co-authored-by: Markus <974709+Links2004@users.noreply.github.com>
2024-12-29 10:25:08 +01:00
ca8026e550 Merge pull request #917 from omarcostahamido/patch-2
fix typos in WebSocketClientSocketIOack.ino
2024-11-17 09:48:25 +01:00
OCH
daf04b0560 Update WebSocketClientSocketIOack.ino
- fix some typos
2024-11-16 18:47:10 +00:00
8cdcf47fc5 Merge pull request #913 from Links2004/dependabot/github_actions/arduino/arduino-lint-action-2
Bump arduino/arduino-lint-action from 1 to 2
2024-10-15 09:02:54 +02:00
1bea689694 Bump arduino/arduino-lint-action from 1 to 2
Bumps [arduino/arduino-lint-action](https://github.com/arduino/arduino-lint-action) from 1 to 2.
- [Release notes](https://github.com/arduino/arduino-lint-action/releases)
- [Commits](https://github.com/arduino/arduino-lint-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: arduino/arduino-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 11:00:40 +00:00
6 changed files with 8 additions and 42 deletions

View File

@ -5,6 +5,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
- uses: arduino/arduino-lint-action@v2
with:
library-manager: update

View File

@ -47,6 +47,7 @@ a WebSocket Server and Client for Arduino based on RFC6455.
### wss / SSL ###
supported for:
- wss client on the ESP8266
- wss / SSL for ESP32 in client mode
- wss / SSL is not natively supported in WebSocketsServer however it is possible to achieve secure websockets
by running the device behind an SSL proxy. See [Nginx](examples/Nginx/esp8266.ssl.reverse.proxy.conf) for a
sample Nginx server configuration file to enable this.

View File

@ -54,7 +54,7 @@ void socketIOEvent(socketIOmessageType_t type, uint8_t * payload, size_t length)
// Message Includes a ID for a ACK (callback)
if(id) {
// creat JSON message for Socket.IO (ack)
// create JSON message for Socket.IO (ack)
DynamicJsonDocument docOut(1024);
JsonArray array = docOut.to<JsonArray>();
@ -130,11 +130,11 @@ void loop() {
if(now - messageTimestamp > 2000) {
messageTimestamp = now;
// creat JSON message for Socket.IO (event)
// create JSON message for Socket.IO (event)
DynamicJsonDocument doc(1024);
JsonArray array = doc.to<JsonArray>();
// add evnet name
// add event name
// Hint: socket.on('event_name', ....
array.add("event_name");
@ -142,7 +142,7 @@ void loop() {
JsonObject param1 = array.createNestedObject();
param1["now"] = (uint32_t) now;
// JSON to String (serializion)
// JSON to String (serialization)
String output;
serializeJson(doc, output);

View File

@ -50,10 +50,7 @@
DEBUG_ESP_PORT.flush(); \
}
#else
#ifdef DEBUG_PORT
#define DEBUG_WEBSOCKETS(...) websocket_debug_printf(__VA_ARGS__)
void websocket_debug_printf(const char * format, ...);
#endif
// #define DEBUG_WEBSOCKETS(...) os_printf( __VA_ARGS__ )
#endif
#endif

View File

@ -1,32 +0,0 @@
#include "WebSockets.h"
#include <stdarg.h>
#ifdef DEBUG_PORT
void websocket_debug_printf(const char * format, ...) {
va_list arg;
va_start(arg, format);
char temp[64];
char * buffer = temp;
size_t len = vsnprintf(temp, sizeof(temp), format, arg);
va_end(arg);
if(len > sizeof(temp) - 1) {
buffer = new(std::nothrow) char[len + 1];
if(!buffer) {
return 0;
}
va_start(arg, format);
vsnprintf(buffer, len + 1, format, arg);
va_end(arg);
}
len = DEBUG_PORT.write((const uint8_t *)buffer, len);
if(buffer != temp) {
delete[] buffer;
}
DEBUG_PORT.flush();
return len;
}
#endif

View File

@ -73,7 +73,7 @@ def get_library_json_version():
def get_header_versions():
data = {}
define = re.compile('^#define WEBSOCKETS_VERSION_?(.*) "?([0-9\\.]*)"?$')
define = re.compile('^#define WEBSOCKETS_VERSION_?(.*) "?([0-9\.]*)"?$')
with open(f'{base_dir}/src/WebSocketsVersion.h', 'r') as f:
for line in f:
m = define.match(line)