Closed instkffff closed 4 years ago
my code
const http = require('http') const https = require('https') const httpProxy = require('http-proxy') const url = require('url') const connect = require('connect') const harmon = require('harmon') selects = [] simpleselect = {} simpleselect1 = {} simpleselect.query = '[src*="jquery.min"]' simpleselect1.query = '[src*="jquery-ui.min"]' simpleselect.func = function(node) { node.setAttribute('src', 'http://libs.baidu.com/jquery/1.5.1/jquery.min.js') } simpleselect1.func = function(node) { node.setAttribute('src', 'http://libs.baidu.com/jqueryui/1.8.10/jquery-ui.min.js') } selects.push(simpleselect) selects.push(simpleselect1) finalUrl = 'https://evemaps.dotlan.net/' parsedUrl = url.parse(finalUrl) proxy = httpProxy.createProxyServer({ target: finalUrl, agent: https.globalAgent, headers: { host: parsedUrl.hostname }, prependPath: false, hostRewrite: finalUrl.host, protocolRewrite: parsedUrl.protocol, xfwd: true }) const app = connect() app.use(harmon([],selects)) app.use(function(req,res){ proxy.web(req,res) }) http.createServer(app).listen(8000)
error got
Error: unexpected end of file at Zlib.zlibOnError [as onerror] (zlib.js:170:17) Emitted 'error' event on Gunzip instance at: at Zlib.zlibOnError [as onerror] (zlib.js:173:8) { errno: -5, code: 'Z_BUF_ERROR'
solved with https://github.com/No9/harmon/pull/50
my code
error got