Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
3b35c87a
Commit
3b35c87a
authored
Jan 05, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: HTTPS through HTTP proxy support (fixes #16165)
parent
1674b861
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
5 deletions
+39
-5
modules/access/http/access.c
modules/access/http/access.c
+9
-4
modules/access/http/connmgr.c
modules/access/http/connmgr.c
+30
-1
No files found.
modules/access/http/access.c
View file @
3b35c87a
...
...
@@ -24,6 +24,8 @@
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <vlc_common.h>
#include <vlc_access.h>
...
...
@@ -160,10 +162,13 @@ static int Open(vlc_object_t *obj)
{
access_t
*
access
=
(
access_t
*
)
obj
;
char
*
proxy
=
vlc_getProxyUrl
(
access
->
psz_url
);
free
(
proxy
);
if
(
proxy
!=
NULL
)
return
VLC_EGENERIC
;
/* FIXME not implemented yet */
if
(
!
strcasecmp
(
access
->
psz_access
,
"http"
))
{
char
*
proxy
=
vlc_getProxyUrl
(
access
->
psz_url
);
free
(
proxy
);
if
(
proxy
!=
NULL
)
return
VLC_EGENERIC
;
/* FIXME not implemented yet */
}
access_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
int
ret
=
VLC_ENOMEM
;
...
...
modules/access/http/connmgr.c
View file @
3b35c87a
...
...
@@ -24,6 +24,7 @@
#include <assert.h>
#include <vlc_common.h>
#include <vlc_network.h>
#include <vlc_tls.h>
#include <vlc_interrupt.h>
#include "transport.h"
...
...
@@ -42,12 +43,40 @@ struct vlc_https_connecting
vlc_sem_t
done
;
};
static
char
*
vlc_https_proxy_find
(
const
char
*
hostname
,
unsigned
port
)
{
const
char
*
fmt
;
char
*
url
,
*
proxy
=
NULL
;
int
canc
=
vlc_savecancel
();
if
(
strchr
(
hostname
,
':'
)
!=
NULL
)
fmt
=
port
?
"https://[%s]:%u"
:
"https://[%s]"
;
else
fmt
=
port
?
"https://%s:%u"
:
"https://%s"
;
if
(
likely
(
asprintf
(
&
url
,
fmt
,
hostname
,
port
)
>=
0
))
{
proxy
=
vlc_getProxyUrl
(
url
);
free
(
url
);
}
vlc_restorecancel
(
canc
);
return
proxy
;
}
static
void
*
vlc_https_connect_thread
(
void
*
data
)
{
struct
vlc_https_connecting
*
c
=
data
;
vlc_tls_t
*
tls
;
tls
=
vlc_https_connect
(
c
->
creds
,
c
->
host
,
c
->
port
,
&
c
->
http2
);
char
*
proxy
=
vlc_https_proxy_find
(
c
->
host
,
c
->
port
);
if
(
proxy
!=
NULL
)
{
tls
=
vlc_https_connect_proxy
(
c
->
creds
,
c
->
host
,
c
->
port
,
&
c
->
http2
,
proxy
);
free
(
proxy
);
}
else
tls
=
vlc_https_connect
(
c
->
creds
,
c
->
host
,
c
->
port
,
&
c
->
http2
);
vlc_sem_post
(
&
c
->
done
);
return
tls
;
}
...
...
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