You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Enhance security and simplify JSON response in Stats API
- Remove sensitive information from error messages (player/publisher keys)
- Use generic "live" key instead of actual publisher names in JSON response
- Move publishers object initialization to success case only
- Reduce information disclosure for improved security
./slc -r srt://[your.sls.ip]:8080?streamid=uplive.sls.com/live/test -i [the full file name of exist ts file]
86
+
./slc -r srt://[your.sls.ip]:4001?streamid=publisher_id -i [the full file name of exist ts file]
84
87
85
88
play srt url
86
89
87
-
./slc -r srt://[your.sls.ip]:8080?streamid=live.sls.com/live/test -o [the full file name of ts file to save]
90
+
./slc -r srt://[your.sls.ip]:4000?streamid=player_id -o [the full file name of ts file to save]
88
91
89
92
90
93
Note:
91
94
=====
92
95
93
-
1.SLS refer to the RTMP url format(domain/app/stream_name), example: www.sls.com/live/test. The url of SLS must be set in streamid parameter of SRT, which will be the unique identification a stream.
96
+
1.SLS uses simple stream IDs without domain/app prefixes. Stream IDs are validated against the streamids.json configuration file.
94
97
95
-
2.How to distinguish the publisher and player of the same stream? In conf file, you can set parameters of domain_player/domain_publisher and app_player/app_publisher to resolve it. Importantly, the two combination strings of domain_publisher/app_publisher and domain_player/app_player must not be equal in the same server block.
98
+
2. Publisher and player connections are distinguished by separate ports (listen_publisher and listen_player).
96
99
97
100
3.I supply a simple android app for test sls, your can download from https://github.com/Edward-Wu/liteplayer-srt
98
101
102
+
New Features (v1.5)
103
+
===================
104
+
105
+
Port-based Publisher/Player Separation (Required)
106
+
-------------------------------------------------
107
+
108
+
The server now requires separate ports for publishers and players, using simple stream IDs:
109
+
110
+
**Configuration:**
111
+
```
112
+
server {
113
+
listen_publisher 4001; # Port for publishers (required)
Stream IDs are now simple values without domain/app prefixes.
125
+
126
+
Stream ID Mapping (Required)
127
+
----------------------------
128
+
129
+
For enhanced security, different stream IDs must be used for publishers and players. This is configured using a JSON file (`streamids.json`):
130
+
131
+
```json
132
+
[
133
+
{
134
+
"publisher": "6a204bd89f3c8348afd5c77c717a097a",
135
+
"player": "422c6f92cd3b84b65e3cb90fab6544f5"
136
+
},
137
+
{
138
+
"publisher": "1de6ce178679f16b48abc7d8a291cb2e",
139
+
"player": "ed8cae86454f037bbcb0856cf1c2f0e3"
140
+
}
141
+
]
142
+
```
143
+
144
+
With this configuration:
145
+
- Publishers must use their specific publisher ID
146
+
- Players use their player ID, which is automatically mapped to the publisher ID
147
+
- Only configured stream IDs are allowed
148
+
- The JSON file must exist and contain valid mappings
149
+
150
+
Statistics API Enhancement
151
+
--------------------------
152
+
153
+
The `/stats/` endpoint accepts only player IDs for security reasons:
154
+
155
+
```
156
+
GET http://server:8080/stats/422c6f92cd3b84b65e3cb90fab6544f5 # Using player ID
157
+
```
158
+
159
+
The player ID is automatically mapped to the corresponding publisher for statistics retrieval.
160
+
161
+
Configuration Requirements
162
+
--------------------------
163
+
164
+
The minimal configuration format:
165
+
166
+
```
167
+
server {
168
+
listen_publisher 4001; # Required
169
+
listen_player 4000; # Required
170
+
171
+
latency 2000;
172
+
backlog 100;
173
+
idle_streams_timeout 3;
174
+
175
+
publisher_exit_delay 10;
176
+
record_hls off;
177
+
record_hls_segment_duration 10;
178
+
}
179
+
```
180
+
181
+
**Breaking Changes:**
182
+
- Domain and app configurations have been removed
183
+
- Single-port configuration is no longer supported
184
+
- Stream IDs are now simple values without prefixes
185
+
- Default stream ID configuration has been removed
186
+
- Statistics are only accessible via player keys
187
+
99
188
ReleaseNote
100
189
============
101
190
102
-
v1.2
191
+
v1.5
103
192
----
104
-
1. update the memory mode, in v1.1 which is publisher copy data to eacc player, in v1.2 each publisher put data to a array and all players read data from this array.
105
-
2. update the relation of the publisher and player, the player is not a member of publisher. the only relation of them is array data.
106
-
3. add push and pull features, support all and hash mode for push, support loop and hash for pull. in cluster mode, you can push a stream to a hash node, and pull this stream from the same hash node.
193
+
1. Port-based publisher/player separation with separate listen_publisher and listen_player ports
194
+
2. Simplified stream ID format without domain/app prefixes
195
+
3. Stream ID mapping with JSON-based security validation
196
+
4. Statistics API accessible only via player keys for enhanced security
1. support hostname:port/app in upstreams of pull and push.
199
+
v1.4
200
+
----
201
+
1. support timestamp synchronization of players, resolve the timestamp rollover issue.
202
+
2. add on_event_url http callback, you can do some work when publisher/player connect/disconnect.
203
+
3. add push and pull features, support all and hash mode for push, support loop and hash for pull. in cluster mode, you can push a stream to a hash node, and pull this stream from the same hash node.
111
204
112
205
v1.3
113
206
----
114
-
1. support reload.
115
-
2. add idle_streams_timeout feature for relay.
116
-
3. change license type from gpl to mit.
207
+
1. support hostname:port/app in upstreams of pull and push.
208
+
2. support hostname/port/app in upstreams of pull and push.
209
+
3. hostname/port/app for upstreams becomes hostname:port/app.
210
+
4. support multiple apps in the same worker, improved the reliability.
1. update the pid file path from "~/" to "/opt/soft/sls/"
150
-
151
-
v1.4.7
152
-
------
153
-
1. update the pid file path from to "/opt/soft/sls/" "/tmp/sls" to avoid the root authority in some case.
215
+
1. update the memory mode, in v1.1 which is publisher copy data to eacc player, in v1.2 each publisher put data to a array and all players read data from this array.
216
+
2. update the relation of the publisher and player, the player is not a member of publisher. the only relation of them is array data.
154
217
218
+
v1.1
219
+
----
220
+
1. support reload configuration file, send SIGUSR1 to sls or call http interface.
221
+
2. support listen multiple ports.
222
+
3. add on_publisher_timeout and on_timeout_publisher for publisher.
223
+
4. add player.on_close_player for player.
224
+
5. OBS streaming compatible, OBS support the srt protocol which is later than v25.0.
155
225
156
-
v1.4.8
157
-
------
158
-
1.for compatible srt v1.4.1, add the set latency method before setup method
226
+
v1.0
227
+
----
228
+
1.add hls output, if you want to save data to hls, config the record_hls,record_hls_segment_duration parameters. sls open the hls option, and hls can be play with Safari directly.
0 commit comments