-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: WebTransport stream now extends abstract stream (#2514)
The PR pulls all of the non-`@fails/webtransport` parts out of #2422 There's a lot of work that's been done to re-use existing libp2p code such as the abstract stream class which handles a lot more closing scenarios than the existing implementation so it would be good to get that in.
- Loading branch information
1 parent
c824323
commit de3f7ae
Showing
13 changed files
with
372 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { CreateListenerOptions, Listener } from '@libp2p/interface' | ||
|
||
export default function createListener (options: CreateListenerOptions): Listener { | ||
throw new Error('Not implemented') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { WebTransportCertificate } from './index.js' | ||
import type { Connection, Upgrader, Listener, CreateListenerOptions, PeerId, ComponentLogger, Metrics } from '@libp2p/interface' | ||
|
||
export interface WebTransportListenerComponents { | ||
peerId: PeerId | ||
logger: ComponentLogger | ||
metrics?: Metrics | ||
} | ||
|
||
export interface WebTransportListenerInit extends CreateListenerOptions { | ||
handler?(conn: Connection): void | ||
upgrader: Upgrader | ||
certificates?: WebTransportCertificate[] | ||
maxInboundStreams?: number | ||
} | ||
|
||
export default function createListener (components: WebTransportListenerComponents, options: WebTransportListenerInit): Listener { | ||
throw new Error('Only supported in browsers') | ||
} |
Oops, something went wrong.