Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to close the websocket connection
Re: How to close the websocket connection [message #49560 is a reply to message #49555] Thu, 01 March 2018 16:55 Go to previous messageGo to previous message
uppjj is currently offline  uppjj
Messages: 9
Registered: February 2018
Location: France
Promising Member
hello all

Mirek,
-in SenRaw you also have to add "mask" line 459 :
else header.Cat((int)len); => else header.Cat((int)len | mask);

-your improvement ... no longer allows me to use "connect". Let me explain :
the server reject : "Get ws://serveur.example.com/chat/sensor-123 HTTP/1.1" // the complete adress
but accept : "Get /chat/sensor-123 HTTP/1.1" // sub adress
if followed by : "Host: server.example.com" // site adress
it is therefore essential to have acces to uri, which in some cases may be different from url.

For the Vector, I am not sure a "Standard header" exist. User should have to delete unwanted items, which is a more complex job than to build all the Header. May be a vectormap with some predefined key "Get", "Host", "Upgrade",Sec-WebSocket-Key" etc.. would facilate the use with "/r/n" taking in account of course.

A good idea should be to add the Websocket Protocol specification RF6455 example in the upp Websocket documentation, to help the user build his own header:
The handshake from the client looks as follows:
GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13


JJ
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Vector<Vector<double>>
Next Topic: how to convert unicode to String
Goto Forum:
  


Current Time: Mon May 06 23:42:26 CEST 2024

Total time taken to generate the page: 0.02523 seconds