mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Remove a couple old SirTunnel files
This commit is contained in:
parent
f24b5fe77b
commit
99da909cde
@ -1,30 +0,0 @@
|
||||
{
|
||||
"apps": {
|
||||
"http": {
|
||||
"servers": {
|
||||
"boreman": {
|
||||
"listen": [":443"],
|
||||
"routes": [
|
||||
{
|
||||
"match": [
|
||||
{
|
||||
"host": ["anders.webstreams.io"]
|
||||
}
|
||||
],
|
||||
"handle": [
|
||||
{
|
||||
"handler": "reverse_proxy",
|
||||
"upstreams": [
|
||||
{
|
||||
"dial": ":9001"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
47
sirtunnel.py
47
sirtunnel.py
@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import json
|
||||
import time
|
||||
from urllib import request
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
host = sys.argv[1]
|
||||
port = sys.argv[2]
|
||||
tunnel_id = host + '-' + port
|
||||
|
||||
caddy_add_route_request = {
|
||||
"@id": tunnel_id,
|
||||
"match": [{
|
||||
"host": [host],
|
||||
}],
|
||||
"handle": [{
|
||||
"handler": "reverse_proxy",
|
||||
"upstreams":[{
|
||||
"dial": ':' + port
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
||||
body = json.dumps(caddy_add_route_request).encode('utf-8')
|
||||
headers = {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
create_url = 'http://127.0.0.1:2019/config/apps/http/servers/boreman/routes'
|
||||
req = request.Request(method='POST', url=create_url, headers=headers)
|
||||
request.urlopen(req, body)
|
||||
|
||||
print("Tunnel created successfully")
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
|
||||
print("Cleaning up tunnel")
|
||||
delete_url = 'http://127.0.0.1:2019/id/' + tunnel_id
|
||||
req = request.Request(method='DELETE', url=delete_url)
|
||||
request.urlopen(req)
|
||||
break
|
Loading…
Reference in New Issue
Block a user