vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
6.74k stars 261 forks source link

Windows Named Pipe Support #88

Open JustinGrote opened 3 years ago

JustinGrote commented 3 years ago

Similar to unix and unix-listen, it would be great if this supported windows named pipes.

The named_pipe crate can be used for this: https://lib.rs/crates/named_pipe

vi commented 3 years ago

A reasonable addition (there is a tokio-named-pipes crate for this).

I don't have a Windows around, so can you test it when it is ready?

vi commented 3 years ago

Tried implementing something (looks like the tokio-named-pipes library supports only clients, if it works at all).

Published a pre-built version to https://github.com/vi/websocat/releases/download/v1.6.0/websocat_win64_pipe.exe. Can you play with it and see if it works?

Specifier is called namedpipeconnect:, so the test can be like this:

websocat -b - namedpipeconnect:<some_path>

(where <some_path> is probably some Windows Pipes-specific thing that I don't really know)

vi commented 3 years ago

Maybe parity-tokio-ipc is a better library for this. Seems like it does support servers on Windows.

JustinGrote commented 3 years ago

Thanks for the fast response! I fired it up and I was able to create a pipe with your syntax, however interacting with the pipe I didn't get anything to flow back and forth

image

vi commented 3 years ago

Do you get back your inputs (like in websocat - mirror:)? I see asdfasdf repeated twice in the screenshot.

Can you somehow attach debugger and see what API calls related to the named pipe does Websocat make?

JustinGrote commented 3 years ago

I will attempt to get this info tomorrow. FYI you could use Github Actions to start up a windows worker and try testing it there as well, as I'm not a rust developer so it may be difficult for me to get you exactly what you need.

vi commented 3 years ago

FYI you could use Github Actions to start up a windows worker and try testing it there as well

Can I interactively login to some shell and use debugging tools there? Or just push&wait&fix&push&....?

JustinGrote commented 3 years ago

Pretty much push/wait, though the project I'm working on is a goal to solve that :).

I've since just ended up writing what I needed in c#, and it works great with the named pipes, so this is less of a priority.

vi commented 3 years ago

Are you still open for testing a build that tries to integrate them in Websocat?