Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update api docs
Browse files Browse the repository at this point in the history
achingbrain committed Jan 14, 2025

Verified

This commit was signed with the committer’s verified signature.
achingbrain Alex Potsides
1 parent 798dbe3 commit 7679d21
Showing 2 changed files with 39 additions and 0 deletions.
28 changes: 28 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -16,12 +16,19 @@ export interface RtcConfig {
bindAddress?: string;
enableIceTcp?: boolean;
enableIceUdpMux?: boolean;
disableAutoNegotiation?: boolean;
disableFingerprintVerification?: boolean;
disableAutoGathering?: boolean;
forceMediaTransport?: boolean;
portRangeBegin?: number;
portRangeEnd?: number;
maxMessageSize?: number;
mtu?: number;
iceTransportPolicy?: TransportPolicy;
disableFingerprintVerification?: boolean;
certificatePemFile?: string;
keyPemFile?: string;
keyPemPass?: string;
}
export const enum RelayType {
@@ -69,6 +76,27 @@ export const enum DescriptionType {
}
```

**setLocalDescription: (sdp: string, init?: LocalDescriptionInit) => void**

Set Local Description and optionally the ICE ufrag/pwd to use. These should not
be set as they will be generated automatically as per the spec.
```
export interface LocalDescriptionInit {
iceUfrag?: string;
icePwd?: string;
}
```

**remoteFingerprint: () => CertificateFingerprint**

Returns the certificate fingerprint used by the remote peer
```
export interface CertificateFingerprint {
value: string;
algorithm: 'sha-1' | 'sha-224' | 'sha-256' | 'sha-384' | 'sha-512' | 'md5' | 'md2';
}
```

**addRemoteCandidate: (candidate: string, mid: string) => void**

Add remote candidate info
11 changes: 11 additions & 0 deletions src/cpp/peer-connection-wrapper.cpp
Original file line number Diff line number Diff line change
@@ -256,6 +256,17 @@ PeerConnectionWrapper::PeerConnectionWrapper(const Napi::CallbackInfo &info) : N
rtcConfig.disableFingerprintVerification = config.Get("disableFingerprintVerification").As<Napi::Boolean>();
}

// Specify certificate to use if set
if (config.Get("certificatePemFile").IsString()) {
rtcConfig.certificatePemFile = config.Get("certificatePemFile").As<Napi::String>().ToString();
}
if (config.Get("keyPemFile").IsString()) {
rtcConfig.keyPemFile = config.Get("keyPemFile").As<Napi::String>().ToString();
}
if (config.Get("keyPemPass").IsString()) {
rtcConfig.keyPemPass = config.Get("keyPemPass").As<Napi::String>().ToString();
}

// Create peer-connection
try
{

0 comments on commit 7679d21

Please sign in to comment.