Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2565dbeb
Commit
2565dbeb
authored
Nov 10, 2011
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tls: Handle connection via a http proxy
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
f5c5d57b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tls.c
libavformat/tls.c
+17
-0
No files found.
libavformat/tls.c
View file @
2565dbeb
...
...
@@ -111,9 +111,15 @@ static int tls_open(URLContext *h, const char *uri, int flags)
char
buf
[
200
],
host
[
200
];
int
numerichost
=
0
;
struct
addrinfo
hints
=
{
0
},
*
ai
=
NULL
;
const
char
*
proxy_path
;
int
use_proxy
;
ff_tls_init
();
proxy_path
=
getenv
(
"http_proxy"
);
use_proxy
=
(
proxy_path
!=
NULL
)
&&
!
getenv
(
"no_proxy"
)
&&
av_strstart
(
proxy_path
,
"http://"
,
NULL
);
av_url_split
(
NULL
,
0
,
NULL
,
0
,
host
,
sizeof
(
host
),
&
port
,
NULL
,
0
,
uri
);
ff_url_join
(
buf
,
sizeof
(
buf
),
"tcp"
,
NULL
,
host
,
port
,
NULL
);
...
...
@@ -123,6 +129,17 @@ static int tls_open(URLContext *h, const char *uri, int flags)
freeaddrinfo
(
ai
);
}
if
(
use_proxy
)
{
char
proxy_host
[
200
],
proxy_auth
[
200
],
dest
[
200
];
int
proxy_port
;
av_url_split
(
NULL
,
0
,
proxy_auth
,
sizeof
(
proxy_auth
),
proxy_host
,
sizeof
(
proxy_host
),
&
proxy_port
,
NULL
,
0
,
proxy_path
);
ff_url_join
(
dest
,
sizeof
(
dest
),
NULL
,
NULL
,
host
,
port
,
NULL
);
ff_url_join
(
buf
,
sizeof
(
buf
),
"httpproxy"
,
proxy_auth
,
proxy_host
,
proxy_port
,
"/%s"
,
dest
);
}
ret
=
ffurl_open
(
&
c
->
tcp
,
buf
,
AVIO_FLAG_READ_WRITE
,
&
h
->
interrupt_callback
,
NULL
);
if
(
ret
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment