|
@@ -777,7 +777,7 @@ int rtcCreateWebSocket(const char *url)
|
|
int rtcCreateWebSocketEx(const char *url, const rtcWsConfiguration *config)
|
|
int rtcCreateWebSocketEx(const char *url, const rtcWsConfiguration *config)
|
|
|
|
|
|
typedef struct {
|
|
typedef struct {
|
|
- bool disableTlsVerification; // if true, disable TLS certificate verification
|
|
|
|
|
|
+ bool disableTlsVerification;
|
|
const char **protocols;
|
|
const char **protocols;
|
|
int protocolsCount;
|
|
int protocolsCount;
|
|
int pingInterval;
|
|
int pingInterval;
|
|
@@ -859,11 +859,10 @@ int rtcCreateWebSocketServer(const rtcWsServerConfiguration *config, rtcWebSocke
|
|
typedef struct {
|
|
typedef struct {
|
|
uint16_t port;
|
|
uint16_t port;
|
|
bool enableTls;
|
|
bool enableTls;
|
|
- const char *certificatePemFile; // NULL for autogenerated certificate
|
|
|
|
- const char *keyPemFile; // NULL for autogenerated certificate
|
|
|
|
- const char *keyPemPass; // NULL if no pass
|
|
|
|
|
|
+ const char *certificatePemFile;
|
|
|
|
+ const char *keyPemFile;
|
|
|
|
+ const char *keyPemPass;
|
|
} rtcWsServerConfiguration;
|
|
} rtcWsServerConfiguration;
|
|
-
|
|
|
|
```
|
|
```
|
|
|
|
|
|
Creates a new WebSocket server.
|
|
Creates a new WebSocket server.
|
|
@@ -871,11 +870,11 @@ Creates a new WebSocket server.
|
|
Arguments:
|
|
Arguments:
|
|
|
|
|
|
- `config`: a structure with the following parameters:
|
|
- `config`: a structure with the following parameters:
|
|
- - `uint16_t port`: the port to listen on (if 0, automatically select an available port)
|
|
|
|
- - `bool enableTls`: if true, enable the TLS layer (WSS)
|
|
|
|
- - `const char *certificatePemFile`: PEM certificate or path of the file containing the PEM certificate (`NULL` for an autogenerated certificate)
|
|
|
|
- - `const char *keyPemFile`: PEM key or path of the file containing the PEM key (`NULL` for an autogenerated certificate)
|
|
|
|
- - `const char *keyPemPass`: PEM key file passphrase (NULL if no passphrase)
|
|
|
|
|
|
+ - `port`: the port to listen on (if 0, automatically select an available port)
|
|
|
|
+ - `enableTls`: if true, enable the TLS layer (WSS)
|
|
|
|
+ - `certificatePemFile` (optional): PEM certificate or path of the file containing the PEM certificate (`NULL` for an autogenerated certificate)
|
|
|
|
+ - `keyPemFile` (optional): PEM key or path of the file containing the PEM key (`NULL` for an autogenerated certificate)
|
|
|
|
+ - `keyPemPass` (optional): PEM key file passphrase (NULL if no passphrase)
|
|
- `cb`: the callback for incoming client WebSocket connections (must not be `NULL`)
|
|
- `cb`: the callback for incoming client WebSocket connections (must not be `NULL`)
|
|
|
|
|
|
`cb` must have the following signature: `void rtcWebSocketClientCallbackFunc(int wsserver, int ws, void *user_ptr)`
|
|
`cb` must have the following signature: `void rtcWebSocketClientCallbackFunc(int wsserver, int ws, void *user_ptr)`
|