Add delete tunnel endpoint
#151
+2
-1
@@ -10,4 +10,5 @@ RUN yarn install --production && yarn cache clean
|
||||
COPY . /app
|
||||
|
||||
ENV NODE_ENV production
|
||||
ENTRYPOINT ["node", "-r", "esm", "./bin/server"]
|
||||
ENV DEBUG *
|
||||
ENTRYPOINT ["node", "-r", "esm", "./bin/server", "--secure", "--max-sockets", "20"]
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name a8c-localtunnel.cyou *.a8c-localtunnel.cyou;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name a8c-localtunnel.cyou *.a8c-localtunnel.cyou;
|
||||
ssl_certificate /etc/letsencrypt/live/a8c-localtunnel.cyou/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/a8c-localtunnel.cyou/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
# proxy_set_header Connection "";
|
||||
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass http://127.0.0.1:1234;
|
||||
|
||||
# Fix for "146656 upstream sent too big header while reading response header from upstream"
|
||||
# https://ma.ttias.be/nginx-proxy-upstream-sent-big-header-reading-response-header-upstream
|
||||
proxy_buffer_size 128k;
|
||||
proxy_buffers 4 256k;
|
||||
proxy_busy_buffers_size 256k;
|
||||
|
||||
# Ugly fix for Connection timed out error
|
||||
proxy_send_timeout 150;
|
||||
proxy_read_timeout 150;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,10 +37,11 @@ class ClientManager {
|
||||
id = hri.random();
|
||||
}
|
||||
|
||||
const maxSockets = this.opt.max_tcp_sockets;
|
||||
const maxTcpSockets = this.opt.max_tcp_sockets;
|
||||
const agent = new TunnelAgent({
|
||||
clientId: id,
|
||||
maxSockets: 10,
|
||||
maxTcpSockets,
|
||||
|
||||
});
|
||||
|
||||
const client = new Client({
|
||||
@@ -63,7 +64,7 @@ class ClientManager {
|
||||
return {
|
||||
id: id,
|
||||
port: info.port,
|
||||
max_conn_count: maxSockets,
|
||||
max_conn_count: maxTcpSockets,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
+4
-2
@@ -28,7 +28,9 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --check-leaks --require esm './**/*.test.js'",
|
||||
"start": "./bin/server",
|
||||
"dev": "node-dev bin/server --port 3000"
|
||||
"start": "node -r esm bin/server --port 1234 --max-sockets 30",
|
||||
"start-docker": "docker run -d --restart always --name localtunnel --net host defunctzombie/localtunnel-server:latest --port 1234",
|
||||
"dev": "node-dev bin/server --port 3000",
|
||||
"stuff": "docker build --tag a8c-lt:1.0 . && docker run -d --restart always --name lt --net host a8c-lt:1.0 --port 1234"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user