-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: WebRTC-Direct support for Node.js
Supports listening and dialing WebRTC Direct multiaddrs in Node.js. Depends on: - [ ] libp2p/go-libp2p#2827 - [ ] paullouisageneau/libdatachannel#1201 - [ ] paullouisageneau/libdatachannel#1204 - [ ] murat-dogan/node-datachannel#257 - [ ] murat-dogan/node-datachannel#256 Closes: - #2581
- Loading branch information
1 parent
90d10b5
commit e2b6537
Showing
21 changed files
with
705 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
export const UFRAG_PREFIX = 'libp2p+webrtc+v1/' |
28 changes: 28 additions & 0 deletions
28
packages/transport-webrtc/src/private-to-public/listener.browser.ts
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,28 @@ | ||
import { TypedEventEmitter } from '@libp2p/interface' | ||
import { unimplemented } from '../error.js' | ||
import type { PeerId, ListenerEvents, Listener } from '@libp2p/interface' | ||
import type { TransportManager } from '@libp2p/interface-internal' | ||
import type { Multiaddr } from '@multiformats/multiaddr' | ||
|
||
export interface WebRTCDirectListenerComponents { | ||
peerId: PeerId | ||
transportManager: TransportManager | ||
} | ||
|
||
export interface WebRTCDirectListenerInit { | ||
shutdownController: AbortController | ||
} | ||
|
||
export class WebRTCDirectListener extends TypedEventEmitter<ListenerEvents> implements Listener { | ||
async listen (): Promise<void> { | ||
throw unimplemented('WebRTCTransport.createListener') | ||
} | ||
|
||
getAddrs (): Multiaddr[] { | ||
return [] | ||
} | ||
|
||
async close (): Promise<void> { | ||
|
||
} | ||
} |
Oops, something went wrong.