Highlighted
Absent Member.
Absent Member.
1858 views

problem about websocket connection

HI, First of all, please excuse my english.

i have a problem about websocket connection.

os: windows 7 64bit

loadrunner version : 12.50

protocol : WEB - HTTP/HTML

 

script data

web_websocket_connect("ID=0", 
        "URI=ws://192.168.0.134:10038/push/echo/CM006002/badgeop02", 
        "Origin=http://192.168.0.134:8100", 
        "OnOpenCB=OnOpenCB0", 
        "OnMessageCB=OnMessageCB0", 
        "OnErrorCB=OnErrorCB0", 
        "OnCloseCB=OnCloseCB0", 
        LAST);

recording data is

$$$$$$ Add Event For Transaction With Id 0 Ended $$$$$$

****** Request Header For Transaction With Id 254 ******
GET /push/echo/CM006002/badgeop02 HTTP/1.1
Origin: http://192.168.0.134:8100
Sec-WebSocket-Key: ykIllDMheog2Bp5QR7mXdA==
Connection: Upgrade
Upgrade: Websocket
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)
Host: 192.168.0.134:10038
DNT: 1
Cache-Control: no-cache
Cookie: JSESSIONID=r6hu8XVDJiSWR6qkNxxwJv4TH83vAmpPry2bF4SmlF1YCZAKQ7xjlLp01mu0TRNz.amV1c19kb21haW4vbXNfaXNzX3B1c2hfZGV2


$$$$$$ Request Header For Transaction With Id 254 Ended $$$$$$

****** Response Header For Transaction With Id 254 ******
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Date: Tue, 31 May 2016 08:25:49 GMT
Connection: upgrade
Sec-WebSocket-Accept: tsH7lI/nFT/kur+zmxeZBF29K3Q=


$$$$$$ Response Header For Transaction With Id 254 Ended $$$$$$

****** Response Body For Transaction With Id 254 ******

$$$$$$ Response Body For Transaction With Id 254 Ended $$$$$$

 

 

but replay data is

Action.c(4): web_websocket_connect started [MsgId: MMSG-26355]
Action.c(4): Start connection: uri=ws://192.168.0.134:10038/push/echo/CM006002/badgeop02, connection handle=114042768 [MsgId: MMSG-26000]
Action.c(4): t=3348ms: Connecting [6] to host 192.168.0.134:10038 [MsgId: MMSG-26000]
Action.c(4): t=3349ms: Connected socket [6] from 192.168.0.19:3760 to 192.168.0.134:10038 in 1 ms [MsgId: MMSG-26000]
Action.c(4): t=3349ms: 613-byte request headers for "ws://192.168.0.134:10038/push/echo/CM006002/badgeop02" (RelFrameId=1, Internal ID=31)
Action.c(4): GET /push/echo/CM006002/badgeop02 HTTP/1.1\r\n
Action.c(4): Connection: Upgrade\r\n
Action.c(4): Host: 192.168.0.134:10038\r\n
Action.c(4): Sec-WebSocket-Key: s4rhWFeTrX4p1JvyGvPWkw==\r\n
Action.c(4): Sec-WebSocket-Version: 13\r\n
Action.c(4): Upgrade: websocket\r\n
Action.c(4): Origin: http://192.168.0.134:8100\r\n
Action.c(4): Referer: http://192.168.0.138:8000/common/createSession.do\r\n
Action.c(4): User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)\r
Action.c(4): \n
Action.c(4): Accept-Encoding: gzip, deflate\r\n
Action.c(4): Accept-Language: ko-KR\r\n
Action.c(4): Accept: */*\r\n
Action.c(4): Connection: Keep-Alive\r\n
Action.c(4): Host: 192.168.0.134:10038\r\n
Action.c(4): Cookie: JSESSIONID=aWhjnBTT2SCAloAH4ayWZvD7zGhurbTZeDUi9YDnRIxYRLePQ051S3ksatDtyuEn.amV1c1
Action.c(4): 9kb21haW4vbXNfaXNzX3p6X2Rldg==\r\n
Action.c(4): \r\n
Action.c(4): t=3356ms: 169-byte response headers for "ws://192.168.0.134:10038/push/echo/CM006002/badgeop02" (RelFrameId=1, Internal ID=31)
Action.c(4): HTTP/1.1 101 Switching Protocols\r\n
Action.c(4): Upgrade: websocket\r\n
Action.c(4): Date: Thu, 02 Jun 2016 07:21:22 GMT\r\n
Action.c(4): Connection: keep-alive\r\n
Action.c(4): Sec-WebSocket-Accept: +dLCOYPtW+oR3vyiCIxfur0Owtw=\r\n
Action.c(4): \r\n
Action.c(4): Connection Failed: uri=ws://192.168.0.134:10038/push/echo/CM006002/badgeop02, connection handle=114042768 [MsgId: MMSG-26000]
Action.c(4): t=23173ms: Inactive socket [1] was closed by 192.168.0.138:8000, probably due to Keep-Alive timeout [MsgId: MMSG-26000]
Action.c(4): t=23173ms: Closed connection [1] to 192.168.0.138:8000 after completing 1 request(s) [MsgId: MMSG-26000]
Action.c(4): Retaining websocket connection of URI="ws://192.168.0.134:10038/push/echo/CM006002/badgeop02" (RelFrameId=1, Internal ID=31) [MsgId: MMSG-27641]
Action.c(4): web_websocket_connect was successful, 0 body bytes, 169 header bytes [MsgId: MMSG-26386]

 

why failed websocket connection?

why is two "Connection" header of request header ?

Tags (1)
0 Likes
1 Reply
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: problem about websocket connection

Could you please try first remove one of the 2 "Host" entries in header? Adding the following line before web_socket_connect

web_remove_auto_header("Host", "", LAST);

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.