-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 socketPath
in node:http request
#9284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
}; | ||
|
||
if (!!$debug) { | ||
fetchOptions.verbose = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like this a lot
fetchOptions.unix = socketPath; | ||
} | ||
|
||
//@ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not need a typescript ignore comment here. but considering the types are a mess and dont work, this can slide
❌ @paperdave 2 files with test failures on linux-x64:
|
❌ @paperdave 3 files with test failures on linux-x64-baseline: |
❌ @paperdave 1 files with test failures on bun-darwin-aarch64: |
❌ @paperdave 1 files with test failures on bun-darwin-x64: |
❌🪟 @paperdave, there are 16 test regressions on Windows x86_64
|
Add a simple http server and client using bun. I wanted to use ipc or communicate over a unix socket, but both options do not work currently with just bun. I tried to use Bun.spawn, but that I couldn't grok how that works in the context a long running server (especially if I want logs). Might revisit that later since it feels like the correct approach at the current scope. Also there seem to be issues with resource usage of Bun.spawn currently. Then wanted to use the Bun server to communicate over a unix socket since the client and server will both be running in the same env. That works, except Bun's `fetch` implementation doesn't currently work with unix sockets (doh!). Fix has been merged on GH but not in release yet (oven-sh/bun#9284). I could revisit this approach on the next release of bun. In the end I'm just using plain old http with a really simple Bun server, no express etc since it's just overkill at this point. The upside is if this ends up scaling at all I might have a hosted server which will need to be http of course.
What does this PR do?
Fixes #6055
Fixes #2734
How did you verify your code works?
There is a test