remove http-proxy dependency

This commit is contained in:
Roman Shtylman
2017-12-10 10:27:03 -08:00
parent 3e12b7ef31
commit ab9b47d2b3
3 changed files with 0 additions and 42 deletions

View File

@@ -3,7 +3,6 @@ import express from 'express';
import tldjs from 'tldjs';
import on_finished from 'on-finished';
import Debug from 'debug';
import http_proxy from 'http-proxy';
import http from 'http';
import Promise from 'bluebird';
@@ -13,21 +12,6 @@ import BindingAgent from './lib/BindingAgent';
const debug = Debug('localtunnel:server');
const proxy = http_proxy.createProxyServer({
target: 'http://localtunnel.github.io'
});
proxy.on('error', function(err) {
log.error(err);
});
proxy.on('proxyReq', function(proxyReq, req, res, options) {
// rewrite the request so it hits the correct url on github
// also make sure host header is what we expect
proxyReq.path = '/www' + proxyReq.path;
proxyReq.setHeader('host', 'localtunnel.github.io');
});
const PRODUCTION = process.env.NODE_ENV === 'production';
// id -> client http server
@@ -252,16 +236,6 @@ module.exports = function(opt) {
res.redirect('https://localtunnel.github.io/www/');
});
// TODO(roman) remove after deploying redirect above
app.get('/assets/*', function(req, res, next) {
proxy.web(req, res);
});
// TODO(roman) remove after deploying redirect above
app.get('/favicon.ico', function(req, res, next) {
proxy.web(req, res);
});
app.get('/api/status', function(req, res, next) {
res.json({
tunnels: stats.tunnels,