Open halfcrazy opened 4 years ago
Currently may be possible only with "Websocat 2"-style pieces (which are not yet assembled into a system and are not default for handing ws://
):
target/debug/websocat -t - \
ws-ll-c:http-request:tcp:192.168.16.93:7789 \
--request-header 'Host: testnginx.com' \
--request-header 'Upgrade: websocket' \
--request-header 'Sec-WebSocket-Key: mYUkMl6bemnLatx/g7ySfw==' \
--request-header 'Sec-WebSocket-Version: 13' \
--request-header 'Connection: Upgrade' \
--request-uri=/
you could use websocat --ws-c-uri=ws://echo.websocket.org/ - ws-c:tcp:127.0.0.1:8888
Connection received on 127.0.0.1 37972
GET / HTTP/1.1
Host: echo.websocket.org
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: a04beHFEo1lslZnLwXJhSA==
For example ./websocat ws://192.168.16.93:7789 -H 'Host: testnginx.com' The header Host field is always 192.168.16.93:7789 not testnginx.com![image](https://user-images.githubusercontent.com/4113173/79679115-9bfabd80-8235-11ea-8619-81d62e56e19f.png)
I have to write /etc/hosts to archive this.![image](https://user-images.githubusercontent.com/4113173/79679121-a74de900-8235-11ea-97df-4eaa195e62df.png)