File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -478,6 +478,19 @@ bool WebSocketsClient::isConnected(void) {
478478 return (_client.status == WSC_CONNECTED);
479479}
480480
481+ /* *
482+ * RFC 6455
483+ * get the full URL/URI of the connection
484+ */
485+ String WebSocketsClient::getUrl (void ) {
486+ #if defined(HAS_SSL)
487+ String protocol = (_client.isSSL ) ? WEBSOCKETS_STRING (" wss://" ) : WEBSOCKETS_STRING (" ws://" );
488+ #else
489+ String protocol = WEBSOCKETS_STRING (" ws://" );
490+ #endif
491+ return protocol + _host + " :" + String (_port) + _client.cUrl ;
492+ }
493+
481494// #################################################################################
482495// #################################################################################
483496// #################################################################################
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ class WebSocketsClient : protected WebSockets {
112112 void disableHeartbeat ();
113113
114114 bool isConnected (void );
115+ String getUrl (void );
115116
116117 protected:
117118 String _host;
You can’t perform that action at this time.
0 commit comments