Commit graph

60 commits

Author SHA1 Message Date
Joachim Bauch
41c18d2531
Protect access to the debug pprof handlers. 2025-10-08 10:46:06 +02:00
Joachim Bauch
41728572fe
Move "StringMap" class to api module. 2025-09-26 13:50:18 +02:00
Joachim Bauch
5892baa3bb
Use interfaces to detect support for remote publishing / streams. 2025-09-09 11:38:48 +02:00
Joachim Bauch
51326069e2
Add dedicated types for different session ids. 2025-09-09 11:38:47 +02:00
Joachim Bauch
3e6428d72f
Add type for string maps. 2025-07-30 10:48:31 +02:00
Joachim Bauch
613806be14
modernize: Replace "interface{}" with "any". 2025-07-30 09:44:18 +02:00
Joachim Bauch
c7cbfcdce2
Support filtering candidates received by clients.
Can be customized through an allow- and blocklist. This can be used to
prevent servers from trying to access private IPs when finding candidate
pairs.
2025-06-12 14:25:45 +02:00
Joachim Bauch
420f7eb0ba
Close connection if last remote publisher is removed. 2025-05-07 10:28:49 +02:00
Joachim Bauch
5c4ffdc7a2
Close subscriber if remote publisher was closed. 2025-05-06 17:01:18 +02:00
Joachim Bauch
3e9d02be00
proxy: Include "X-Spreed-Signaling-Features" header in all responses. 2025-04-16 14:29:50 +02:00
Joachim Bauch
32a86fdd76
Don't capitalize error messages. 2025-03-26 14:03:29 +01:00
Joachim Bauch
71ceadbf4c
Add more cases when to stop remote publishing. 2024-11-11 10:47:05 +01:00
Joachim Bauch
c12addb2a8
Notify remote to stop publishing when last local subscriber is closed. 2024-11-11 10:26:42 +01:00
Joachim Bauch
e152b8dcda
Migrate to github.com/golang-jwt/jwt/v5 2024-11-05 09:59:14 +01:00
Joachim Bauch
a487afc909
Support passing codec parameters when creating publishers. 2024-11-04 13:35:03 +01:00
Joachim Bauch
4dd2bbaf63
proxy: Close client connection if session is expired / closed.
This handles cases where during development the machine is suspended and
on resume, the session is expired but the connection is still open. As
for the expired session the internal context is closed, the session can
no longer be used.
2024-10-31 13:55:22 +01:00
Joachim Bauch
9aeb57d74e
Encode session ids using protobufs.
This will reduce their size and improve encoding / decoding performance.

Also fixes GO-2024-3106 (Stack exhaustion in Decoder.Decode in encoding/gob).
2024-10-28 14:47:46 +01:00
Joachim Bauch
8077ca4104
proxy: Implement "bye" message. 2024-10-28 10:17:38 +01:00
Joachim Bauch
e1fc062464
proxy: Add timeouts to requests to Janus and cancel if session is closed. 2024-10-28 09:24:23 +01:00
Joachim Bauch
6e1a2f6d7e
Include list of supported features in websocket response. 2024-06-03 11:14:19 +02:00
Joachim Bauch
c17882307f
proxy: Support reloading target bandwidth. 2024-05-28 13:19:58 +02:00
Joachim Bauch
c7cccc9287
Support reloading maximum stream / screen bandwidths. 2024-05-28 12:33:12 +02:00
Joachim Bauch
2a1fd2e018
Support reloading allowed stats IPs. 2024-05-28 12:18:08 +02:00
Joachim Bauch
be66d9425b
Support reloading trusted proxies. 2024-05-28 12:11:39 +02:00
Joachim Bauch
c6cbe88d0e
Pass contexts when creating / starting MCUs. 2024-05-21 09:29:23 +02:00
Joachim Bauch
7e7a6d5c09
Support bandwidth limits when selecting proxy to use. 2024-05-21 09:29:20 +02:00
Joachim Bauch
a4b8a81734
Automatically reconnect proxy connections if interrupted. 2024-05-21 09:29:19 +02:00
Joachim Bauch
3ce963ee91
Re-create publisher with new endpoint if it already exists. 2024-05-21 09:29:19 +02:00
Joachim Bauch
56f5a72f61
Get list of remote streams from offer/answer SDP. 2024-05-21 09:29:17 +02:00
Joachim Bauch
9c99129242
Make "skipverify" configurable for remote proxy requests. 2024-05-21 09:29:15 +02:00
Joachim Bauch
63c42dd84c
First draft of remote subscriber streams. 2024-05-21 09:29:15 +02:00
Joachim Bauch
aac4874e72
Make trusted proxies configurable and default to loopback / private IPs. 2024-05-16 14:44:00 +02:00
Joachim Bauch
bad52af35a
Validate received SDP earlier. 2024-05-16 10:04:57 +02:00
Joachim Bauch
e3a163fbe5
Support environment variables in URL / listener configuration. 2024-05-13 13:26:38 +02:00
Joachim Bauch
1a8444ca71
Reuse backoff waiting code for initial proxy MCU connection. 2024-02-27 16:42:06 +01:00
Joachim Bauch
8f4fc2db6d
Calculate proxy load based on maximum bandwidth.
Take maximum bandwidth of connected clients into account when calculating
load as screensharing requires more than regular audio/video.
2024-02-27 15:20:17 +01:00
Joachim Bauch
7d09c71ab9
Strongly type "StreamType". 2024-02-27 15:20:14 +01:00
Joachim Bauch
59cf86d786
Add "welcome" endpoint to proxy. 2024-01-24 10:45:49 +01:00
Joachim Bauch
c134883138
Switch to atomic types from Go 1.19 2023-10-30 09:32:46 +01:00
Joachim Bauch
fd29f83454
Use "struct{}" channel if only used as signaling mechanism. 2023-06-15 11:30:28 +02:00
Joachim Bauch
be949f90b1
Add common code to handle allowed IPs. 2023-03-16 17:11:57 +01:00
Joachim Bauch
d49d3704fa
Use interface for client callbacks. 2023-02-22 08:34:17 +01:00
Joachim Bauch
156bc360ff
Add hello version "2.0" that authenticates connections using a JWT. 2022-08-03 16:33:45 +02:00
Joachim Bauch
924fce6713
Stop using deprecated "jwt.StandardClaims". 2022-07-07 17:12:21 +02:00
Joachim Bauch
8a97fa7f5e
Update to Go module version of github.com/golang-jwt/jwt 2022-07-07 17:04:34 +02:00
Joachim Bauch
f7db8a38e1
Send initial "welcome" message when clients connect.
This can be used to detect server features before performing the
actual "hello" handshake.
2022-07-07 09:57:10 +02:00
Daniel Calviño Sánchez
e86baba54d Discard unneeded messages based on their "sid" parameter
If a message includes a "sid" parameter and it does not match the one
from the publisher or the subscriber the message is ignored. However, if
the message does not include a "sid" parameter it is processed just like
before for backwards compatibility.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-27 11:14:59 +02:00
Daniel Calviño Sánchez
3636e69dba Add specific ID for connections
A new ID is introduced for publishers and subscribers to be able to
identify different connections in the same session. While it was
possible to do that from the Janus handles this ID is meant to be shared
with the clients and set by the peer sending the offer, so it is set by
the client for publishers and by the signaling server for subscribers
(in which case the Janus handle is used).

This will make possible to know without any ambiguity if an offer/answer
belongs to an already existing connection or not. This can be used, for
example, to know if an offer represents an update or a new connection,
or to discard unneeded messages that might be sent in some corner cases
by the clients.

The ID name is "sid" for consistency with the property name used by the
internal signaling server of Talk.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-27 11:14:59 +02:00
Joachim Bauch
5101b16df3
Return dedicated error if proxy receives token that is not valid yet.
This can happen for example if the times of the machines running the
signaling server and proxy don't match.
2022-03-23 13:13:32 +01:00
Joachim Bauch
9f86c80c33
Only stop MCU if started before. 2022-03-23 11:46:17 +01:00