json-rpc

command
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 14 Imported by: 0

README

json-rpc

ion-sfu supports a json-rpc interface for connecting peers to the sfu

Quick Start

Serving over http
go build cmd/server/json-rpc/main.go
./main -c config.toml -a ":7000"
Serving over https

Generate a keypair and run:

go build cmd/server/json-rpc/main.go
./main -c config.toml -key ./key.pem -cert ./cert.pem -a "0.0.0.0:10000"

API

Join

Initialize a peer connection and join a session.

{
    "sid": "defaultroom",
    "offer": {
        "type": "offer",
        "sdp": "..."
    }
}
Offer

Offer a new sdp to the sfu. Called to renegotiate the peer connection, typically when tracks are added/removed.

{
    "desc": {
        "type": "offer",
        "sdp": "..."
    }
}
Answer

Answer a remote offer from the sfu. Called in response to a remote renegotiation. Typically when new tracks are added to/removed from other peers.

{
    "desc": {
        "type": "answer",
        "sdp": "..."
    }
}
Trickle

Provide an ICE candidate.

{
    "candidate": "..."
}

Documentation

Overview

Package cmd contains an entrypoint for running an ion-sfu instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL