https://github.com/jungdu/rtc-socket-connector-server
A library on the server-side for establishing WebRTC connection.
https://github.com/jungdu/rtc-socket-connector-server
express nodejs socket-io webrtc
Last synced: 8 months ago
JSON representation
A library on the server-side for establishing WebRTC connection.
- Host: GitHub
- URL: https://github.com/jungdu/rtc-socket-connector-server
- Owner: jungdu
- Created: 2021-12-14T16:53:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T14:50:34.000Z (over 2 years ago)
- Last Synced: 2025-10-12T14:09:19.583Z (8 months ago)
- Topics: express, nodejs, socket-io, webrtc
- Language: TypeScript
- Homepage:
- Size: 74.2 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rtc-socket-connector-server
rtc-socket-connector-server is library for WebRTC connection.
This library used with [**rtc-socket-connector-client**]([r](https://github.com/jungdu/rtc-socket-connector-client))
It is easy to use WebRTC with **rtc-socket-connector-server** and [**rtc-socket-connector-client**](https://github.com/jungdu/rtc-socket-connector-client).
**Example using this library**: [rtc-socket-connector-example](https://github.com/jungdu/rtc-socket-connector-example)
# How to use
### 1. Create socket server
To use rtc-socket-connector-server, you need socket server.
Create a socket server through the process below.
```javascript
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require("socket.io");
const socketServer = new Server(server);
```
### 2. add handlers to Socket Server
Use **addRTCConnectionHandlers** to handle socket messages form client.
```javascript
const { addRTCConnectionHandlers } = require("rtc-socket-connector-server")
addRTCConnectionHandler(socketServer});
```
### 3. Start the server
Run script file to run express server.
A client will send socket messages to the express server.
The express server will send messages from a client to target client.
# API
### addRTCConnectionHandler(server, option)
**Arguments**
- server: Socket server created by using socket.io
- option
- debug``````: Set ```true``` to log messages for initiating peer connections and ICE candidates.