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 #49567 is a reply to message #48944] Sat, 03 March 2018 00:18 Go to previous messageGo to previous message
uppjj is currently offline  uppjj
Messages: 9
Registered: February 2018
Location: France
Promising Member
Some web sites require an adress like this:

"Get ws://serveur.example.com/subfolder/... HTTP/1.1" and dont'care about "Host:...

others require an adress like that (and reject the above):

"Get /subfolder/... HTTP/1.1"
"Host: serveur.example.com

I am in the second case for my project.
as Websocket::Connect("ws://...") now always send message beginning with"Get ws://..." it is impossible to connect to second kind of site.


for the moment I use the previous version of your websocket.cpp which gives the complete control of the header, with full unfixed request_header :
Nvl(request_header, // complete control
"GET " + uri + " HTTP/1.1\r\n" // rejected by some web sites
"Host: " + host + "\r\n"

Its not pure soft because I have to run:
- a copy of the beginning of WebSocket::Connect to separate "Host" and "subfolder" from url,
- a copy of random websocket key computing,
- then run connect() with url again (which is not used but must be correct to avoid a "return false"...)

but it does the job !


I do not see any difference between url and uri in websocket.cpp.

have a nice week end

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 20:53:55 CEST 2024

Total time taken to generate the page: 0.01994 seconds