Jmeter Websocket Test details, jmeterwebsocket

Source: Internet
Author: User

Jmeter Websocket Test details, jmeterwebsocket

1. Websocket is a persistent connection. First, a connection is established through the http protocol.

The websocket protocol continuously interacts with the server, and the protocol is passive, so the server can take the initiative

The following figure shows the specific packet capture status of the notification client. After Websocket connection, it can be seen that a request is sent to the server.

No need to establish an http connection again


1. analyze the differences between Websocket and http at the interface layer.

Headers: Upgrade and Connection indicate the request type. The Sec-WebSocket-mainly carries

Some websocket parameters are returned by the same server.


Obviously, websocket can communicate with each other in the 101 status of the http connection.

2. Compile and test the jmeter script

1. Download The websocket dependent jar and put it in the/apache-jmeter-3.2/lib/ext directory.
2. Open WebSocket Sampler

2. write scripts
Ip: Test server Domain Name
Streaming Connection: whether to keep the Connection after the request. If this option is selected, continue the session in the same http
Protocol: ws/wss, wss encrypted transmission after websocket connection, according to the actual write
Port Number: ws80, wss443, same as http and https
Path: Write the specific request url
Request data: the content of each client request can be seen through charles packet capture.

By using the loop controller, you will find that you only need to establish a link and the subsequent request content will continue in this connection.

Iii. Comparison of ws/wss protocol and wireshark packet capture Analysis

When websocket is ws protocol, execute the interface to capture packets as follows to start http three-way handshake, and then request http

Request, websocket can be seen to be transmitted in plaintext

When websocket is a wss protocol, run the following interface to capture packets:

Start http three-way handshake and then connect to https. We can see that TLS v1.2 has been used for encrypted transmission.

 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.