Vishal Chepuri
Vishal Chepuri

Reputation: 320

How to manually add WebSocket Header in Jmeter?

I am using jmeter plugin (WebSocket Samplers by Peter Doornbosch) for creating websocket requests manually.

Opening the connection to websocket

The connection also requires sessionID.
I tried http header manager but it doesn't takes up the header while execution.

SO, is there a way to manually add websocket header to the (Websocket open connection) sampler?

Upvotes: 1

Views: 2751

Answers (1)

Peter
Peter

Reputation: 847

Http Header Manager is the way to go; the sampler picks up all the headers, except the ones that are used by the WebSocket or HTTP protocol itself (e.g. "Host", "Sec-WebSocket-Key"). If your header is called "sessionID", it definitely should work. See also the "Basic request-response sample with Header and Cookie Manager.jmx" example in the samples directory (https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/samples/)

Are you 100% sure the sampler did not include the header? Did you check the HTTP GET request with a tool like WireShark?

Upvotes: 4

Related Questions