src/WSclient.cpp
void WebSocketsClient::begin(const char *host, uint16_t port, const char * url, const char * protocol) {
    _host = host;
    _port = port;
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
    _fingerprint = "";
#endif

    _client.num = 0;
    _client.status = WSC_NOT_CONNECTED;
    _client.tcp = NULL;
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
    _client.isSSL = false;
    _client.ssl = NULL;
#endif
    _client.cUrl = url;
    _client.cCode = 0;
    _client.cIsUpgrade = false;
    _client.cIsWebsocket = true;
    _client.cKey = "";
    _client.cAccept = "";
    _client.cProtocol = protocol;
    _client.cExtensions = "";
    _client.cVersion = 0;
    _client.base64Authorization = "";
    _client.plainAuthorization = "";
    _client.isSocketIO = false;

#ifdef ESP8266
    randomSeed(RANDOM_REG32);
#else
    // todo find better seed
    randomSeed(millis());
#endif
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
    asyncConnect();
#endif

    _lastConnectionFail = 0;
    _reconnectInterval = 500;
}
/**
 * calles to init the Websockets server
 */
calles to init the Websockets server
calles to init the Websockets server
void WebSocketsClient::begin(const char *host, uint16_t port, const char * url, const char * protocol) {
    _host = host;
    _port = port;
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
    _fingerprint = "";
#endif
    _client.num = 0;
    _client.status = WSC_NOT_CONNECTED;
    _client.tcp = NULL;
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
    _client.isSSL = false;
    _client.ssl = NULL;
#endif
    _client.cUrl = url;
    _client.cCode = 0;
    _client.cIsUpgrade = false;
    _client.cIsWebsocket = true;
    _client.cKey = "";
    _client.cAccept = "";
    _client.cProtocol = protocol;
    _client.cExtensions = "";
    _client.cVersion = 0;
    _client.base64Authorization = "";
    _client.plainAuthorization = "";
    _client.isSocketIO = false;
#ifdef ESP8266
    randomSeed(RANDOM_REG32);
#else
    randomSeed(millis());
#endif
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
    asyncConnect();
#endif
    _lastConnectionFail = 0;
    _reconnectInterval = 500;
}
void WebSocketsClient :: begin ( const char * host , uint16_t port , const char * url , const char * protocol ) { _host = host ; _port = port ; #if ( WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266 ) || ( WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32 ) _fingerprint = " " ; #endif _client . num = 0 ; _client . status = WSC_NOT_CONNECTED ; _client . tcp = NULL ; #if ( WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266 ) || ( WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32 ) _client . isSSL = false ; _client . ssl = NULL ; #endif _client . cUrl = url ; _client . cCode = 0 ; _client . cIsUpgrade = false ; _client . cIsWebsocket = true ; _client . cKey = " " ; _client . cAccept = " " ; _client . cProtocol = protocol ; _client . cExtensions = " " ; _client . cVersion = 0 ; _client . base64Authorization = " " ; _client . plainAuthorization = " " ; _client . isSocketIO = false ; #ifdef ESP8266 randomSeed ( RANDOM_REG32 ) ; #else randomSeed ( millis ( ) ) ; #endif #if ( WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC ) asyncConnect ( ) ; #endif _lastConnectionFail = 0 ; _reconnectInterval = 500 ; }
calles to init the Websockets server
calles to init the Websockets server
// todo find better seed