Closed yarglah closed 5 years ago
I'm cooking Websocat 2.0.0 now, and maybe I'll add an option to selectively forward headers to environment variables when executing scripts. Note that it may be not very secure do you things like shellshock.
Maybe I can also try making a special build for you that just forwards all headers. Which platform do you need?
Hi,
I'm aware that bash must be robustified, but it's only for POC devlopments. I use Debian x64 (websocat_1.4.0_ssl1.1_amd64.deb).
Thanks !
Prepared a special build: https://vi-server.org/pub/websocat_headers_1.4.0_amd64.deb
The source code is in all_headers_forward
branch.
% websocat -Eeb ws-l:0.0.0.0:1234 sh-c:env
$ websocat -H 'Qqq: Www' -Eb ws://127.0.0.1:1234/ | grep H_
H_Upgrade=websocket
H_Host=127.0.0.1:1234
H_Connection=Upgrade
H_Qqq=Www
It is not certain that this feature will be implemented in Websocat 2.0 as is. Probably explicit header list will be required and values may be base64-encoded.
What a reactivity. Very impressive.
I will test it tomorrow.
Thanks !
It works perfectly.
@yarglah, Released v1.5.0 with --header-to-env
option.
It is less flexible than "headers" version, as you need to explicitly specify which headers to forward.
Thank you very much Vitaly.
Have a nice day.
Hi,
First thanks for this tool ! I use it in many context (client / serveur / windows / Linux) for tests or POC purpose.
Is there a way for a program run by websocat (--exec) to get HTTP headers (I wish to get cookies) ? Websocket server display headers with -v -v option, but I can't found a way to get them in my bash script:
From client
Script: