mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-07-28 01:18:35 +00:00
feat: client http proxy
This commit is contained in:
26
app/internal/http/server_test.py
Normal file
26
app/internal/http/server_test.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
|
||||
proxies = {
|
||||
'http': 'http://127.0.0.1:18080',
|
||||
'https': 'http://127.0.0.1:18080',
|
||||
}
|
||||
|
||||
|
||||
def test_http(it):
|
||||
for i in range(it):
|
||||
r = requests.get('http://127.0.0.1:18081', proxies=proxies)
|
||||
print(r.status_code, r.text)
|
||||
assert r.status_code == 200 and r.text == 'control is an illusion'
|
||||
|
||||
|
||||
def test_https(it):
|
||||
for i in range(it):
|
||||
r = requests.get('https://127.0.0.1:18082',
|
||||
proxies=proxies, verify=False)
|
||||
print(r.status_code, r.text)
|
||||
assert r.status_code == 200 and r.text == 'control is an illusion'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_http(10)
|
||||
test_https(10)
|
Reference in New Issue
Block a user