socketIO for low level programming Board
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
hi, i am try to connect the socketIO server v4 using Arduino and building library for socketIO at low level communication. but i did't find the work flow of client and server handshake and hard to connect to socketIO server using Arduino
boards list:
Arduino UNO + EthernetShield For ENC28J60 or W5100
Arduino + WifiShield For ESP8266 or ESP32
Following code to rebuilt:
#include "Arduino.h"
#if defined(W5100)
#include <Ethernet.h>
#include "SPI.h" //For W5100
#elif defined(ENC28J60)
#include <UIPEthernet.h>
#include "SPI.h" //For ENC28J60
#elif defined(ESP8266)
#include <ESP8266WiFi.h> //For ESP8266
#elif defined(ESP32)
#include <WiFi.h> //For ESP32
#elif (!defined(ESP32) && !defined(ESP8266) && !defined(W5100) && !defined(ENC28J60)) //If no interface is defined
#error "Please specify an interface such as W5100, ENC28J60, ESP8266 or ESP32"
#error "above your includes like so : #define ESP8266 "
#endif
// Length of static data buffers
#define DATA_BUFFER_LEN 120
#define SID_LEN 24
class SocketIOClient {
public:
bool connect(char hostname[], int port = 80, char query[] = "");
bool connectHTTP(char hostname[], int port = 80);
bool connected();
void disconnect();
bool reconnect(char hostname[], int port = 80, char query[] = "");
bool monitor();
void sendMessage(String message = "");
void send(String RID, String Rname, String Rcontent);
void sendNSP();
void sendJSON(String RID, String JSON);
void heartbeat(int select);
void clear();
void getREST(String path);
void postREST(String path, String type, String data);
void putREST(String path, String type, String data);
void deleteREST(String path);
private:
void parser(int index);
void sendHandshake(char hostname[], char query[] = "");
#if defined(W5100) || defined(ENC28J60)
EthernetClient client; //For ENC28J60 or W5100
#endif
#if defined(ESP8266) || defined(ESP32)
WiFiClient client; //For ESP8266 or ESP32
#endif
bool readHandshake();
void readLine();
char *dataptr;
char databuffer[DATA_BUFFER_LEN];
char sid[SID_LEN];
char key[28];
int pingInterval;
int pingTimeout;
char *upgrades;
char *hostname;
char *query;
char *nsp;
int port;
void findColon(char which);
void terminateCommand(void);
bool waitForInput(void);
void eatHeader(void);
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files, tests, or entry points; begin by reviewing the Socket.IO v4 client-server handshake documentation and the Arduino board constraints described here. A completed contribution would define and implement the requested low-level Arduino client workflow, with documented support boundaries and validation against the listed boards.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100