Skip to content

Commit

Permalink
Merge branch 'mdastgheib-feature/referer/header/field' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Sep 22, 2023
2 parents 74c7144 + 7888247 commit b089edc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 6 deletions.
14 changes: 14 additions & 0 deletions src/views/Edit/Sources/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const initSettings = (initialSettings) => {
forceFramerate: false,
framerate: 25,
userAgent: '',
referer: '',
http_proxy: '',
...settings.http,
};
Expand Down Expand Up @@ -287,6 +288,10 @@ const createInputs = (settings, config, skills) => {
input.options.push('-user_agent', settings.http.userAgent);
}

if (settings.http.referer.length !== 0) {
input.options.push('-referer', settings.http.referer);
}

if (settings.http.http_proxy.length !== 0) {
input.options.push('-http_proxy', settings.http.http_proxy);
}
Expand Down Expand Up @@ -546,6 +551,15 @@ function AdvancedSettings(props) {
onChange={props.onChange('http', 'userAgent')}
/>
</Grid>
<Grid item xs={12}>
<TextField
variant="outlined"
fullWidth
label="Referrer"
value={settings.http.referer}
onChange={props.onChange('http', 'referer')}
/>
</Grid>
<Grid item xs={12}>
<TextField
variant="outlined"
Expand Down
41 changes: 35 additions & 6 deletions src/views/Edit/Sources/Network.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const pullmatrix = {
forceFramerate: true,
framerate: 25,
userAgent: 'foobaz/1',
referer: 'http://example.com',
http_proxy: '',
},
general: {
Expand Down Expand Up @@ -128,7 +129,21 @@ pullmatrix.tests = [
skills: $skills_ffmpeg4,
input: {
address: 'http://admin:[email protected]/live/stream.m3u8',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 20000000, '-re', '-r', 25, '-user_agent', 'foobaz/1'],
options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-analyzeduration',
20000000,
'-re',
'-r',
25,
'-user_agent',
'foobaz/1',
'-referer',
'http://example.com',
],
},
},
{
Expand Down Expand Up @@ -164,7 +179,21 @@ pullmatrix.tests = [
skills: $skills_ffmpeg5,
input: {
address: 'http://admin:[email protected]/live/stream.m3u8',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 20000000, '-re', '-r', 25, '-user_agent', 'foobaz/1'],
options: [
'-fflags',
'+genpts',
'-thread_queue_size',
512,
'-analyzeduration',
20000000,
'-re',
'-r',
25,
'-user_agent',
'foobaz/1',
'-referer',
'http://example.com',
],
},
},
{
Expand Down Expand Up @@ -285,7 +314,7 @@ pushmatrix.tests = [
skills: $skills_ffmpeg4,
config: $config,
input: {
address: 'rtmp://localhost/live/external.stream?token=foobar',
address: '{rtmp,name=external.stream}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000],
},
},
Expand All @@ -295,7 +324,7 @@ pushmatrix.tests = [
skills: $skills_ffmpeg4,
config: $config,
input: {
address: 'srt://localhost?mode=caller&transtype=live&streamid=external,mode:request,token:foobar&passphrase=bazfoobazfoo',
address: '{srt,name=external.stream,mode=request}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512],
},
},
Expand All @@ -305,7 +334,7 @@ pushmatrix.tests = [
skills: $skills_ffmpeg5,
config: $config,
input: {
address: 'rtmp://localhost/live/external.stream?token=foobar',
address: '{rtmp,name=external.stream}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512, '-analyzeduration', 3000000],
},
},
Expand All @@ -315,7 +344,7 @@ pushmatrix.tests = [
skills: $skills_ffmpeg5,
config: $config,
input: {
address: 'srt://localhost?mode=caller&transtype=live&streamid=external,mode:request,token:foobar&passphrase=bazfoobazfoo',
address: '{srt,name=external.stream,mode=request}',
options: ['-fflags', '+genpts', '-thread_queue_size', 512],
},
},
Expand Down

0 comments on commit b089edc

Please sign in to comment.