diff options
Diffstat (limited to 'src/invidious/helpers/proxy.cr')
-rw-r--r-- | src/invidious/helpers/proxy.cr | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/invidious/helpers/proxy.cr b/src/invidious/helpers/proxy.cr index 4f415ba0..af114e29 100644 --- a/src/invidious/helpers/proxy.cr +++ b/src/invidious/helpers/proxy.cr | |||
@@ -1,3 +1,7 @@ | |||
1 | def connect(path : String, &block : HTTP::Server::Context -> _) | ||
2 | Kemal::RouteHandler::INSTANCE.add_route("CONNECT", path, &block) | ||
3 | end | ||
4 | |||
1 | # See https://github.com/crystal-lang/crystal/issues/2963 | 5 | # See https://github.com/crystal-lang/crystal/issues/2963 |
2 | class HTTPProxy | 6 | class HTTPProxy |
3 | getter proxy_host : String | 7 | getter proxy_host : String |
@@ -124,7 +128,7 @@ def get_nova_proxies(country_code = "US") | |||
124 | client.connect_timeout = 10.seconds | 128 | client.connect_timeout = 10.seconds |
125 | 129 | ||
126 | headers = HTTP::Headers.new | 130 | headers = HTTP::Headers.new |
127 | headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" | 131 | headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" |
128 | headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" | 132 | headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" |
129 | headers["Accept-Language"] = "Accept-Language: en-US,en;q=0.9" | 133 | headers["Accept-Language"] = "Accept-Language: en-US,en;q=0.9" |
130 | headers["Host"] = "www.proxynova.com" | 134 | headers["Host"] = "www.proxynova.com" |
@@ -161,7 +165,7 @@ def get_spys_proxies(country_code = "US") | |||
161 | client.connect_timeout = 10.seconds | 165 | client.connect_timeout = 10.seconds |
162 | 166 | ||
163 | headers = HTTP::Headers.new | 167 | headers = HTTP::Headers.new |
164 | headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36" | 168 | headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" |
165 | headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" | 169 | headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" |
166 | headers["Accept-Language"] = "Accept-Language: en-US,en;q=0.9" | 170 | headers["Accept-Language"] = "Accept-Language: en-US,en;q=0.9" |
167 | headers["Host"] = "spys.one" | 171 | headers["Host"] = "spys.one" |