-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When I run this proxy, I get this error
Error: socket hang up
at createHangUpError (_http_client.js:330:15)
at Socket.socketOnEnd (_http_client.js:431:23)
at Socket.emit (events.js:202:15)
at Socket.EventEmitter.emit (domain.js:446:20)
at endReadableNT (_stream_readable.js:1129:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
I tried to fix it and I found this, if I replace the target in original code, from this
const proxy = httpProxy.createProxy({
agent: http.globalAgent,
target: { host, port },
ws: true
});
to this
const proxy = httpProxy.createProxy({
agent: http.globalAgent,
target: `http://localhost:${port}`,
ws: true
});
It works. I don't really understand why. Maybe you can help me explain it.
I fixed the code in my case, and I also replace the backend to localhost if it's the same with proxy IP.
MateusMendesSantana
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request