Skip to content

Commit 22416c9

Browse files
authored
Merge pull request #125 from xgi/feature/114-proxies
Feature/114 proxies fixes #114
2 parents dd8f0d2 + 2eb83d5 commit 22416c9

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

castero/net.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def Get(*args, **kwargs) -> requests.models.Response:
3030
*args,
3131
headers=Net.HEADERS,
3232
timeout=float(castero.config.Config['request_timeout']),
33+
proxies={
34+
'http': castero.config.Config['proxy_http'],
35+
'https': castero.config.Config['proxy_https'],
36+
},
3337
**kwargs
3438
)
3539

@@ -39,5 +43,9 @@ def GGet(*args, **kwargs):
3943
*args,
4044
headers=Net.HEADERS,
4145
timeout=float(castero.config.Config['request_timeout']),
46+
proxies={
47+
'http': castero.config.Config['proxy_http'],
48+
'https': castero.config.Config['proxy_https'],
49+
},
4250
**kwargs
4351
)

castero/templates/castero.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ player =
5656
# default: (blank)
5757
execute_command =
5858

59+
# An HTTP or SOCKS proxy to use for HTTP network requests.
60+
# example: http://user:pass@10.10.1.10:3128
61+
# example: socks5://user:pass@host:port
62+
# default: (blank)
63+
proxy_http =
64+
65+
# An HTTP or SOCKS proxy to use for HTTPS network requests.
66+
# example: http://user:pass@10.10.1.10:3128
67+
# example: socks5://user:pass@host:port
68+
# default: (blank)
69+
proxy_https =
70+
5971

6072
[feeds]
6173
# Whether to reload/refresh your feeds when the client starts. Depending on how

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-vlc==3.0.7110
22
python-mpv==0.4.5
3-
requests==2.23.0
3+
requests[socks]==2.24.0
44
grequests==0.6.0
55
pytest==5.3.5
66
CJKwrap==2.2

0 commit comments

Comments
 (0)