As I am trying to connect to web-socket for subscribing messages its failing and rejecting the request.
I see that the previous call for Authentication is successful.
t=16976ms: 10-byte response body for "">example.com/.../authentication" (RelFrameId=1, Internal ID=5)
Authorized
As I get the message Authorized above.
In the next call for Web-Socket Connection I am not getting it CONNECTED as expected buts failing with the message: Request Rejected</title></head><body>The requested URL was rejected
LR script:
-----------
I am doing LR script as follows:
I have opted web_add_header("Sec-WebSocket-Key","AUTO") as but I don't see any value in the extended logs.
lr_start_transaction("A02T01 - ws Connect");
web_set_sockets_option("SSL_VERSION","TLS1.2");
web_add_header("Host","HOST");
web_add_header("Connection","Upgrade");
web_add_header("Upgrade","websocket");
web_add_header("Sec-WebSocket-Key","AUTO");
web_add_header("Sec-WebSocket-Version","13");
web_add_header("Sec-WebSocket-Extensions","permessage-deflate; client_max_window_bits");
web_add_header("JSESSIONID", "{corr_jsessionid}");
//web_add_header("JSESSIONID", "0000s-keGhhhGG3hqe5Qf-rdLVO:-1; Path=/; Secure; HttpOnly");
web_custom_request("web_custom_request",
"URL=wss://URL/ws/api/v9/WebSocket-PDS",
"Method=GET",
"TargetFrame=",
"Resource=0",
"snapshot=t2.inf",
"Referer=",
//"Mode=HTTP",
"Body={ \"type\": \"sub\", \"data\": { \"subject\": [ \"/stocks/book/[NAME]0000\" ] }}",
LAST);
lr_end_transaction("A02T01 - MDF Connect", LR_AUTO);
return 0;
}
Extended Logs:
------------------------
I have provided the LR extended log trace how I am using it as below.
A01_Authentication.c(236): t=16977ms: Request done "">URL/.../authentication" [MsgId: MMSG-26000]
A01_Authentication.c(236): web_rest("POST: Websocket Auth") was successful, 10 body bytes, 734 header bytes [MsgId: MMSG-26386]
A01_Authentication.c(257): Notify: Transaction "A01T05 - Post Websocket Auth" ended with a "Pass" status (Duration: 0.5399 Wasted Time: 0.0056).
A01_Authentication.c(259): Notify: Transaction "A02T01 - MDF Connect" started.
A01_Authentication.c(261): web_add_header("Host") started [MsgId: MMSG-26355]
A01_Authentication.c(261): Warning -26594: The header being added may cause unpredictable results if applied to ALL the URLs generated on behalf of the next script function. It will apply to the primary URL only. [MsgId: MWAR-26594]
A01_Authentication.c(261): "Host: HOST" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(261): web_add_header("Host") highest severity level was "warning" [MsgId: MMSG-26391]
A01_Authentication.c(262): web_add_header("Connection") started [MsgId: MMSG-26355]
A01_Authentication.c(262): "Connection: Upgrade" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(262): web_add_header("Connection") was successful [MsgId: MMSG-26392]
A01_Authentication.c(263): web_add_header("Upgrade") started [MsgId: MMSG-26355]
A01_Authentication.c(263): "Upgrade: websocket" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(263): web_add_header("Upgrade") was successful [MsgId: MMSG-26392]
A01_Authentication.c(264): web_add_header("Sec-WebSocket-Key") started [MsgId: MMSG-26355]
A01_Authentication.c(264): An unrecognized header ("Sec-WebSocket-Key") is being added [MsgId: MMSG-26595]
A01_Authentication.c(264): "Sec-WebSocket-Key: AUTO" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(264): web_add_header("Sec-WebSocket-Key") was successful [MsgId: MMSG-26392]
A01_Authentication.c(265): web_add_header("Sec-WebSocket-Version") started [MsgId: MMSG-26355]
A01_Authentication.c(265): An unrecognized header ("Sec-WebSocket-Version") is being added [MsgId: MMSG-26595]
A01_Authentication.c(265): "Sec-WebSocket-Version: 13" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(265): web_add_header("Sec-WebSocket-Version") was successful [MsgId: MMSG-26392]
A01_Authentication.c(266): web_add_header("Sec-WebSocket-Extensions") started [MsgId: MMSG-26355]
A01_Authentication.c(266): An unrecognized header ("Sec-WebSocket-Extensions") is being added [MsgId: MMSG-26595]
A01_Authentication.c(266): "Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(266): web_add_header("Sec-WebSocket-Extensions") was successful [MsgId: MMSG-26392]
A01_Authentication.c(267): web_add_header("JSESSIONID") started [MsgId: MMSG-26355]
A01_Authentication.c(267): Notify: Parameter Substitution: parameter "corr_jsessionid" = "0000s-keGhhhGG3hqe5Qf-rdLVO:-1; Path=/; Secure; HttpOnly"
A01_Authentication.c(267): An unrecognized header ("JSESSIONID") is being added [MsgId: MMSG-26595]
A01_Authentication.c(267): "JSESSIONID: 0000s-keGa2PZP3hqe5Qf-rdLVO:-1; Path=/; Secure; HttpOnly" header registered for adding to requests from the immediately following Action function [MsgId: MMSG-26506]
A01_Authentication.c(267): web_add_header("JSESSIONID") was successful [MsgId: MMSG-26392]
A01_Authentication.c(269): web_custom_request("web_custom_request") started [MsgId: MMSG-26355]
A01_Authentication.c(269): Warning: The string ' "subject": [ "/stocks/book/[NAME]0000" ] ' with parameter delimiters is not a parameter.
A01_Authentication.c(269): t=17151ms: Already connected [0] to URL:PORT [MsgId: MMSG-26000]
A01_Authentication.c(269): t=17151ms: 743-byte request headers for "wss://URL/ws/api/v1/WebSocket-PDS" (RelFrameId=1, Internal ID=6)
A01_Authentication.c(269): PUT /ws/api/v1/WebSocket-PDS HTTP/1.1\r\n
A01_Authentication.c(269): Host: URL\r\n
A01_Authentication.c(269): Connection: Upgrade\r\n
A01_Authentication.c(269): Upgrade: websocket\r\n
A01_Authentication.c(269): Sec-WebSocket-Key: AUTO\r\n
A01_Authentication.c(269): Sec-WebSocket-Version: 13\r\n
A01_Authentication.c(269): Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n
A01_Authentication.c(269): JSESSIONID: 0000s-keGa2PZP3hqe5Qf-rdLVO:-1; Path=/; Secure; HttpOnly\r\n
A01_Authentication.c(269): User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)\r\n
A01_Authentication.c(269): Accept-Encoding: gzip, deflate\r\n
A01_Authentication.c(269): Accept: */*\r\n
A01_Authentication.c(269): Content-Length: 83\r\n
A01_Authentication.c(269): \r\n
A01_Authentication.c(269): t=17151ms: 83-byte request body for "wss://URL/ws/api/v1/WebSocket-PDS" (RelFrameId=1, Internal ID=6)
A01_Authentication.c(269): { "type": "sub", "data": { "subject": [ "/stocks/book/[APP]1010" ] }}
A01_Authentication.c(269): t=17194ms: 165-byte response headers for "wss://URL/ws/api/v1/WebSocket-PDS" (RelFrameId=1, Internal ID=6)
A01_Authentication.c(269): HTTP/1.1 200 OK\r\n
A01_Authentication.c(269): Cache-Control: no-cache\r\n
A01_Authentication.c(269): Connection: close\r\n
A01_Authentication.c(269): Content-Type: text/html; charset=utf-8\r\n
A01_Authentication.c(269): Pragma: no-cache\r\n
A01_Authentication.c(269): Content-Length: 246\r\n
A01_Authentication.c(269): Vary: Accept-Encoding\r\n
A01_Authentication.c(269): \r\n
A01_Authentication.c(269): t=17195ms: 246-byte response body for "wss://URL/ws/api/v1/WebSocket-PDS" (RelFrameId=1, Internal ID=6)
A01_Authentication.c(269): <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Pl
A01_Authentication.c(269): ease consult with your administrator.<br><br>Your support ID is: 9253226741085691330<br><b
A01_Authentication.c(269): r><a href='javascript:history.back();'>[Go Back]</a></body></html>
A01_Authentication.c(269): t=17196ms: Closing connection [0] to server URL - server indicated that the connection should be closed [MsgId: MMSG-26000]
A01_Authentication.c(269): t=17196ms: Closed connection [0] to URL:protocol after completing 2 request(s) [MsgId: MMSG-26000]
A01_Authentication.c(269): t=17196ms: Request done "wss://URL/ws/api/v1/WebSocket-PDS" [MsgId: MMSG-26000]
A01_Authentication.c(269): web_custom_request("web_custom_request") was successful, 246 body bytes, 165 header bytes [MsgId: MMSG-26386]
A01_Authentication.c(280): Notify: Transaction "A02T01 - MDF Connect" ended with a "Pass" status (Duration: 0.2164 Wasted Time: 0.0092).
Could you please see if you can help in this?