Anonymous User
  Thursday, 01 December 2022
  1 Replies
  0.9K Visits
  Subscribe
I'm using WAMP to communicate with 3rd party server.
We are currently using TsgcWebSocketClient and TsgcWSPClient_WAMP version 3.4 with Delphi 10 Seattle. Server is using JWAMP/Jetty.

When updating SGC websocket to version 2022.5.0 and Delphi 11, connection is no longer working.
Debugger raises exception: "Project xxx.exe raised exception class TsgcWSException with message 'Protocol not supported .'.'"

Any idea what could be the reason?

Log of connection attempt for both versions:

---------------------------------------------------------------
Delphi 11 and websockets 2022.5.0
---------------------------------------------------------------
Stat Connected.
Sent 01/12/2022 15.38.31: GET /ccinfo/ HTTP/1.1
Host: 10.0.1.151:8554
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: x/lyhzZmwQJfiWrMvE6N6w==
Origin: 10.0.1.151
Sec-WebSocket-Protocol: WAMP
Sec-WebSocket-Version: 13


Recv 01/12/2022 15.38.31: HTTP/1.1 101 Switching Protocols
Date: Thu, 01 Dec 2022 13:38:31 GMT
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: PzTXz0/T2xSyKYFu9xcEtlD7EMs=


Stat Disconnected.

---------------------------------------------------------------
Delphi 10 and websockets 3.4
---------------------------------------------------------------
Stat Connected.
Sent 1.12.2022 15.42.44: GET /ccinfo/ HTTP/1.1
Host: 10.0.1.151:8554
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: rhG3QCuHxqhjWOBag9myrA==
Origin: 10.0.1.151
Sec-WebSocket-Protocol: WAMP
Sec-WebSocket-Version: 13


Recv 1.12.2022 15.42.44: HTTP/1.1 101 Switching Protocols
Date: Thu, 01 Dec 2022 13:42:42 GMT
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: JNAQebN5ATeQxkAY6o3ytYdMWsM=

Upgraded over HTTP/1.1
Recv 1.12.2022 15.42.44: :[0,"W-d8ab99d0-ad98-42d9-b1f2-2de3b34988c3",1,"jwamp/0.1"]
2 years ago
·
#1297
Hello,

In the old version, if the client request a protocol and the server doesn't support this protocol, the connection was not closed. This was fixed some time ago, if the client sends a protocol and the server doesn't accept this protocol in the header "Sec-WebSocket-Protocol" the connection is closed.

If you check the log, you will see that the client sends the following header in the request:

Sec-WebSocket-Protocol: WAMP

While the server, although accept the connection, it doesn't sends this protocol in the response, so this means the server doesn't support the protocol.

Kind Regards,
Sergio
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf,pas,dfm,dpr,dproj,dpk
· Insert · Remove
  Upload Files (Maximum 10MB)