Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support For Calling Unix Domain Sockets #230

Open
zicklag opened this issue Feb 10, 2022 · 2 comments
Open

Support For Calling Unix Domain Sockets #230

zicklag opened this issue Feb 10, 2022 · 2 comments

Comments

@zicklag
Copy link
Contributor

zicklag commented Feb 10, 2022

Hey there!

I really love using xh, good job on it, I use it all the time!

I ran into a need to make requests to a unix domain socket, and it would be nifty if xh could support that to.

A convenient way to do it would be to support unix:// URLs and then using everything after unix:// as a file path to the unix socket.

@blyxxyz
Copy link
Collaborator

blyxxyz commented Feb 11, 2022

HTTPie has a plugin for this (an old one, I don't know if it still works?): https://github.com/httpie/httpie-unixsocket
If we add this we should use the same interface.

reqwest doesn't support this directly (yet): seanmonstar/reqwest#39

There is this: https://github.com/softprops/hyperlocal
I don't remember if a hyper client can be converted to a reqwest client, but if so that might be enough to support it.

@blyxxyz
Copy link
Collaborator

blyxxyz commented Jan 16, 2024

I'm looking at prior art again. got also has support, and:

  • Its syntax is nicer than the HTTPie plugin: http://unix:/var/run/docker.sock:/containers/json rather than http+unix://%2Fvar%2Frun%2Fdocker.sock/containers/json.
    • There doesn't seem to be a standard for this.
    • The plugin isn't super popular, maybe we can do without drop-in compatibility.
    • %2F shouldn't be strictly necessary to distinguish between filepath slashes and URL slashes, we could probe the filesystem. (But maybe we shouldn't, it'd e.g. give worse typo handling.)
    • We need something the url crate can handle.
  • got got a redirect CVE. We have to make sure we're not vulnerable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants