Erro on applying header

Issue #47 invalid
Former user created an issue

I am getting error in jmeter logs if I add some headers in the websocket request response sampler. ERROR e.l.w.WebSocketClient: Ignoring user supplied header 'Sec-WebSocket-Key=b9uFghlklZxGkaRr5Z1Juw== ERROR e.l.w.WebSocketClient: Ignoring user supplied header 'Connection=Upgrade'

Comments (9)

  1. Peter Doornbosch repo owner

    The error is indicating you are adding these headers yourself, which is not necessary and therefore ignored by the plugin.

    Why do you attempt to add there headers yourself?

  2. Shailendra

    In My application first request is for handshaking, we are required to send some headers, which sampler is not creating, like Sec-WebSocket-Key. If I don't send this header request is getting failed/

  3. Peter Doornbosch repo owner

    Are you talking about websocket handshaking (i.e. the upgrade request)? The sampler is doing it for you and the sampler is sending the Sec-WebSocket-Key header.

    I don't get the question. Please provide more information, explain better what you're doing, what kind of behaviour you are experiencing and why it is a problem.

  4. Shailendra

    Yes, its websocket handshaking. When I am sending sampler request without header manager, Sec-WebSocket-Key header is not send by sampler and request fails. And when I add header manger with Sec-WebSocket-Key header its is getting passed but with error in logs.

    Ideally Sec-WebSocket-Key header should be generated by sampler. Is there any configuration required?

  5. Peter Doornbosch repo owner

    The sampler is generating the Sec-WebSocket-Key. No matter whether you have an header manager or not. See for example the "Basic request-response sample.jmx" in the samplers dir (https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/66990a0701af79a046c872fada1eb63781ee7033/samples/?at=master).

    If you are sure it does not in your case (how did you conclude it doesn't? Do you have a wireshark communication trace?), please enable debug logging (see below), send me your jmeter.log file and your test plan, or - even better - provide a reproduction scenario with a public service (like echo.websocket.org).

    To enable debug logging, add the following lines to jmeter.properties:

    log_level.eu.luminis.jmeter=DEBUG

    log_level.eu.luminis.websocket=DEBUG

  6. Shailendra

    I was checking for headers in JMeter GUI pannel. When I checked with wireshark found default headers are added by the sampler.

    I removed default headers from header manager and added only application specific headers and it is working fine. In wireshark I can see all headers.

    First time I am using this plugin and it is really helpful.

    Thanks for you support.

  7. Peter Doornbosch repo owner

    Your welcome.

    I guess that the conclusion of this conversation is that it is confusing that the headers generated by the plugin are not visible in the results. I'll put that on my todo list.

    Cheers Peter

  8. Srishti agarwal

    I need the solution for my problem.

    In my socket based application, I am not able to see the request headers in the web socket sampler that my request is having. Both the request and the response headers are coming blank for the web socket sampler , (still sampler is giving success code). but not able to get the proper response as expected, Please help with some solution.

  9. Log in to comment