-
Notifications
You must be signed in to change notification settings - Fork 503
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
fix: unify connect options #881
Conversation
I had to remove a test as it incorrectly relies on mutating options. Also not sure how that could work at all as the session cache does not key on cipher. |
Codecov Report
@@ Coverage Diff @@
## main #881 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 2104 2106 +2
=========================================
+ Hits 2104 2106 +2
Continue to review full report at Codecov.
|
@szmarczak This would allow you to forward a custom lookup function directly to |
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.
lgtm
I am late to this, sorry. Great work! |
Great job! Any manual on how to change the options (I need to use a custom lookup function) ? |
The |
I'm not sure how to use it in Dispatch, I've just updated to the latest Undici, how do I add lookup in Dispatch? |
You don't need to use dispatch. Just pass |
Wow, thank you so much for the quick reply.
Agent should be placed in the new Client? Sorry |
const client = new Client('http://google.com', {
connect: { lookup: CUSTOM_FUNCTION }
})
const { body, statusCode, headers } = await client.request({
path: '/',
method: 'GET',
headers: {
// Headers
},
}) |
Oh! You are amazing. thank you so much @ronag |
EDIT: When getting the Master branch, it seems that "Client" doesn't exist anymore.
npm install git://github.com/nodejs/undici/tree/master --save This is the right branch? correct? From what I'm seeing in index.js, a lot of things changed especially in what is exported or not, is it normal? Edit: it works if I change my imports to: Is it normal that the behavior is different or it's because I don't do it properly? Well it seems to not work at all anymore, even changing new Client by new undici.Client, I keep getting weird errors Sorry I'm lost |
The branch that works with the option you are looking for is here: Master seems behind (version 3) |
Please open a separate issue. |
* fix: unify connect options Fixes: nodejs#852 * fixup
Should be fully backwards compatible.