Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7679d21

Browse files
committedJan 14, 2025
chore: update api docs
1 parent 798dbe3 commit 7679d21

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
 

‎API.md

+28
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ export interface RtcConfig {
1616
bindAddress?: string;
1717
enableIceTcp?: boolean;
1818
enableIceUdpMux?: boolean;
19+
disableAutoNegotiation?: boolean;
20+
disableFingerprintVerification?: boolean;
21+
disableAutoGathering?: boolean;
22+
forceMediaTransport?: boolean;
1923
portRangeBegin?: number;
2024
portRangeEnd?: number;
2125
maxMessageSize?: number;
2226
mtu?: number;
2327
iceTransportPolicy?: TransportPolicy;
2428
disableFingerprintVerification?: boolean;
29+
certificatePemFile?: string;
30+
keyPemFile?: string;
31+
keyPemPass?: string;
2532
}
2633
2734
export const enum RelayType {
@@ -69,6 +76,27 @@ export const enum DescriptionType {
6976
}
7077
```
7178

79+
**setLocalDescription: (sdp: string, init?: LocalDescriptionInit) => void**
80+
81+
Set Local Description and optionally the ICE ufrag/pwd to use. These should not
82+
be set as they will be generated automatically as per the spec.
83+
```
84+
export interface LocalDescriptionInit {
85+
iceUfrag?: string;
86+
icePwd?: string;
87+
}
88+
```
89+
90+
**remoteFingerprint: () => CertificateFingerprint**
91+
92+
Returns the certificate fingerprint used by the remote peer
93+
```
94+
export interface CertificateFingerprint {
95+
value: string;
96+
algorithm: 'sha-1' | 'sha-224' | 'sha-256' | 'sha-384' | 'sha-512' | 'md5' | 'md2';
97+
}
98+
```
99+
72100
**addRemoteCandidate: (candidate: string, mid: string) => void**
73101

74102
Add remote candidate info

‎src/cpp/peer-connection-wrapper.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,17 @@ PeerConnectionWrapper::PeerConnectionWrapper(const Napi::CallbackInfo &info) : N
256256
rtcConfig.disableFingerprintVerification = config.Get("disableFingerprintVerification").As<Napi::Boolean>();
257257
}
258258

259+
// Specify certificate to use if set
260+
if (config.Get("certificatePemFile").IsString()) {
261+
rtcConfig.certificatePemFile = config.Get("certificatePemFile").As<Napi::String>().ToString();
262+
}
263+
if (config.Get("keyPemFile").IsString()) {
264+
rtcConfig.keyPemFile = config.Get("keyPemFile").As<Napi::String>().ToString();
265+
}
266+
if (config.Get("keyPemPass").IsString()) {
267+
rtcConfig.keyPemPass = config.Get("keyPemPass").As<Napi::String>().ToString();
268+
}
269+
259270
// Create peer-connection
260271
try
261272
{

0 commit comments

Comments
 (0)