-
Notifications
You must be signed in to change notification settings - Fork 145
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
feat: Add customTag
parameter to the tunnelConnectResponded event
#411
Conversation
…dd tunnelConnectError event
src/server.ts
Outdated
@@ -73,6 +74,7 @@ export type PrepareRequestFunctionResult = { | |||
localAddress?: string; | |||
ipFamily?: number; | |||
dnsLookup?: typeof dns['lookup']; | |||
metadata?: Record<string, unknown>; |
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.
Please can you document this in readme?
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.
btw does this need to be a dictionary? why not any object user-supplied object?
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.
Agreed with Honza's points, plus it would be nice to have a test for these events, unless it would be too much work to add.
Otherwise it looks good 🙂
README.md
Outdated
|
||
// Optional metadata that will be passed back via | ||
// `tunnelConnectResponded` or `tunnelConnectFailed` events | ||
metadata: { userId: '123' }, |
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.
sorry, just one last note 🙈 wouldn't it make more sense to call this tag
or customTag
rather than metadata
? metadata has a specific meaning. Your call @jirimoravcik
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.
Good point, I went with customTag
, smaller chance of a meaning conflict due to the name
metadata
parameter to the tunnelConnectResponded eventcustomTag
parameter to the tunnelConnectResponded event
Also add
tunnelConnectFailed
event.This is used to pass information that was passed by
prepareRequestFunction
back via events