3030
3131#if WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266 && WEBSERVER_HAS_HOOK
3232
33- class WebSockets4WebServer : public WebSocketsServerCore {
33+ class WebSockets4WebServer : public WebSocketsServerCore {
3434 public:
35-
36- WebSockets4WebServer (const String& origin = " " , const String& protocol = " arduino" ):
37- WebSocketsServerCore (origin, protocol)
38- {
35+ WebSockets4WebServer (const String & origin = " " , const String & protocol = " arduino" )
36+ : WebSocketsServerCore(origin, protocol) {
3937 begin ();
4038 }
4139
42- ESP8266WebServer::HookFunction hookForWebserver (const String& wsRootDir, WebSocketServerEvent event)
43- {
40+ ESP8266WebServer::HookFunction hookForWebserver (const String & wsRootDir, WebSocketServerEvent event) {
4441 onEvent (event);
4542
46- return [&, wsRootDir](const String & method, const String & url, WiFiClient * tcpClient, ESP8266WebServer::ContentTypeFunction contentType)
47- {
48- if (!(method == " GET" && url.indexOf (wsRootDir) == 0 )) {
43+ return [&, wsRootDir](const String & method, const String & url, WiFiClient * tcpClient, ESP8266WebServer::ContentTypeFunction contentType) {
44+ if (!(method == " GET" && url.indexOf (wsRootDir) == 0 )) {
4945 return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
5046 }
5147
@@ -55,8 +51,7 @@ class WebSockets4WebServer: public WebSocketsServerCore {
5551 // Then initialize a new WSclient_t (like in WebSocketsServer::handleNewClient())
5652 WSclient_t * client = handleNewClient (newTcpClient);
5753
58- if (client)
59- {
54+ if (client) {
6055 // give "GET <url>"
6156 String headerLine;
6257 headerLine.reserve (url.length () + 5 );
@@ -71,6 +66,6 @@ class WebSockets4WebServer: public WebSocketsServerCore {
7166 }
7267};
7368
74- #endif // WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266 && WEBSERVER_HAS_HOOK
69+ #endif // WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266 && WEBSERVER_HAS_HOOK
7570
76- #endif // __WEBSOCKETS4WEBSERVER_H
71+ #endif // __WEBSOCKETS4WEBSERVER_H
0 commit comments