Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got error on zlib #52

Closed
instkffff opened this issue Mar 20, 2020 · 1 comment
Closed

got error on zlib #52

instkffff opened this issue Mar 20, 2020 · 1 comment

Comments

@instkffff
Copy link

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'
@instkffff
Copy link
Author

solved with #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant