You are not logged in.
Pages: 1
Thanks AB.
BTW, I am testing Project31SimpleEchoServer with supplied Project31SimpleEchoServer.html client. This works ok.
There is some way to find all connected sockets in the server and send information to?
Offline
Solved by this way : http://pastebin.com/UrMHSneL
Another question... Chrome and Firefox returns a 401 and 400 when try to access : http://localhost:8888/whatever/
IExplorer goes well.
Last edited by turrican (2017-01-23 16:30:32)
Offline
Solved by this way : http://pastebin.com/UrMHSneL
Another question... Chrome and Firefox returns a 401 and 400 when try to access : http://localhost:8888/whatever/
IExplorer goes well.
If you compile with mORMot versions of October or earlier, it works correctly on all web browsers: Chrome, Firefox ... etc
That's what I tried to say here:
https://synopse.info/forum/viewtopic.php?id=3747
Last edited by rclaros (2017-01-23 20:24:32)
Offline
Problem comes this way at SynBidirSock.pas
prot.fRemoteIP := ClientSock.RemoteIP;
prot.fRemoteLocalhost := ClientSock.RemoteIP='127.0.0.1';
extin := ClientSock.HeaderValue('Sec-WebSocket-Extensions');
if extin<>'' then begin
CSVToRawUTF8DynArray(pointer(extin),extins,';',true);
if not prot.ProcessHandshake(extins,extout,nil) then begin
prot.Free;
result := STATUS_UNAUTHORIZED;
exit;
end;
end;
I'm going to compare IExplorer requests with Chrome and Firefox.
Offline
Ok... I think the problem comes with the next situation :
- Firefox and Chrome passes Sec-WebSocket-Extensions:"permessage-deflate" header to server and server do the next thing :
extin := ClientSock.HeaderValue('Sec-WebSocket-Extensions');
if extin<>'' then begin
CSVToRawUTF8DynArray(pointer(extin),extins,';',true);
if not prot.ProcessHandshake(extins,extout,nil) then begin
prot.Free;
result := STATUS_UNAUTHORIZED;
exit;
end;
end;
Server aborts negotiation if ClientSock.HeaderValue('Sec-WebSocket-Extensions')
function TWebSocketProtocol.ProcessHandshake(const ExtIn: TRawUTF8DynArray; out ExtOut: RawUTF8;
ErrorMsg: PRawUTF8): boolean;
begin
result := false; // abort negotiation in case of any extension
end;
Override the ProcessHandshake method with Result := true;
So I don't know why Arnaud did this implementation. He will explain better than me.
Offline
Thanks turrican,
Interesting analysis you have done.
I confirm that making the change you have put in "ProcessHandshake" with "Result: = true;"
It works correctly in the web browser: "Chrome" but still does not work with "Microsoft Edge"
When comparing the SynBidirSock.pas files of the current version with the October (Works in all web browsers):
The parts of the code you have published do not exist in the October version.
Offline
Please try https://synopse.info/fossil/info/5d8cde8b6d
Offline
Pages: 1