Home » U++ Library support » U++ Core » How to close the websocket connection
Re: How to close the websocket connection [message #49574 is a reply to message #48944] |
Sun, 04 March 2018 15:51  |
uppjj
Messages: 9 Registered: February 2018 Location: France
|
Promising Member |
|
|
Ok thanks. This is working now with your new code, with url containing subfolder or not :
// adress
String Host,SubFolder;
bool ssl;
Adress_Split(Url,Host,SubFolder,ssl);
// header
WS_Client.ClearHeaders().Header("Upgrade","websocket").Header( "Connection","Upgrade").Header("Sec-WebSocket-Version", "13"); // may be standard part of header ?
WS_Client.Header("Sec-WebSocket-Protocol","your_protocol")...; // custom part
// connect
WS_Client.Connect(SubFolder,Host,ssl); // ok working now !
...
with :
void Adress_Split(const String& url,String& host,String& Subfolder,bool& ssl)
{// copy of the beginning of connect(url)
Subfolder = url;
const char *u = url;
ssl = memcmp(u, "wss", 3) == 0;
//--- Host
const char *t = u;
while(*t && *t != '?')
if(*t++ == '/' && *t == '/')
{
u = ++t;
break;
}
t = u;
while(*u && *u != ':' && *u != '/' && *u != '?')
u++;
host = String(t, u);
//--- SubFolder (JJ)
while(*u && *u != '/' && *u != '?') u++;
if (*u !=0) Subfolder = u;
}
|
|
|
 |
|
How to close the websocket connection
By: Tess on Tue, 07 November 2017 11:37
|
 |
|
Re: How to close the websocket connection
|
 |
|
Re: How to close the websocket connection
By: mirek on Wed, 15 November 2017 08:57
|
 |
|
Re: How to close the websocket connection
|
 |
|
Re: How to close the websocket connection
By: uppjj on Wed, 14 February 2018 19:17
|
 |
|
Re: How to close the websocket connection
By: mirek on Sat, 17 February 2018 12:01
|
 |
|
Re: How to close the websocket connection
By: uppjj on Sat, 24 February 2018 15:59
|
 |
|
Re: How to close the websocket connection
By: mirek on Sat, 24 February 2018 17:07
|
 |
|
Re: How to close the websocket connection
By: uppjj on Wed, 28 February 2018 15:24
|
 |
|
Re: How to close the websocket connection
By: mirek on Wed, 28 February 2018 16:25
|
 |
|
Re: How to close the websocket connection
By: Klugier on Wed, 28 February 2018 23:27
|
 |
|
Re: How to close the websocket connection
By: uppjj on Thu, 01 March 2018 16:55
|
 |
|
Re: How to close the websocket connection
By: mirek on Fri, 02 March 2018 15:28
|
 |
|
Re: How to close the websocket connection
By: uppjj on Sat, 03 March 2018 00:18
|
 |
|
Re: How to close the websocket connection
By: mirek on Sat, 03 March 2018 10:19
|
 |
|
Re: How to close the websocket connection
By: uppjj on Sun, 04 March 2018 15:51
|
Goto Forum:
Current Time: Thu Jun 12 06:19:25 CEST 2025
Total time taken to generate the page: 0.03751 seconds
|