-
Notifications
You must be signed in to change notification settings - Fork 459
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: auto-tls for websockets #2800
Conversation
Depends on #2798 and probably some others. |
fc491dc
to
3b2c111
Compare
Starts a tcp server on the listen port and hands connections off to internal http or https servers (depdending on connection type). Upgrade requests from both servers are handled by a websocket server. The https server is enabled when either a secure websocket address is listened to explicitly, or when a TLS certificate is provisioned by another libp2p component, likely `@libp2p/auto-tls`. This means we don't need to add another port mapping for the https server since we run http and https over the same port.
3b2c111
to
b97e91a
Compare
Merging to get a rc out for further testing |
@achingbrain Hey 👋 , |
@achingbrain So I digged a bit more and the problem is coming from async _invokeStartableMethod(methodName) {
for (const [key, value] of Object.entries(this.components)) {
if (isStartable(value)) {
await value[methodName]?.();
}
}
} But i don't think this is what you want ? |
We could also change the transport manager to call listen on start and not afterStart but I don't know the implication of such a change |
Starts a tcp server on the listen port and hands connections off to internal http or https servers (depdending on connection type).
Upgrade requests from both servers are handled by a websocket server.
The https server is enabled when either a secure websocket address is listened to explicitly, or when a TLS certificate is provisioned by another libp2p component, likely
@libp2p/auto-tls
.This means we don't need to add another port mapping for the https server since we run http and https over the same port.
Change checklist