SocketError: other side closed
See original GitHub issueUpon connecting to a proxy with user:pass it’s all good, but when I try to make a request to an proxy which is IP authenticated, I get ‘SocketError: other side closed’. I’m not sending the proxy-authorization header as it’s not needed. Blanked the proxy ip and port below.
var Client = require('undici');
(async ()=>{
const client = new Client("http://proxyip:proxyport")
const response = await client.request({
method: 'GET',
path: 'https://api.ipify.org?format=json',
headers: {
//'proxy-authorization': `Basic ${Buffer.from(':').toString('base64')}`
}
})
response.body.setEncoding('utf8')
let data = ''
for await (const chunk of response.body) {
data += chunk
}
//
console.log(response.statusCode)
console.log(JSON.parse(data))
client.close()
})();
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:34 (25 by maintainers)
Top Results From Across the Web
How to know when the socket on the other side is closed
When a recv returns 0 bytes, it means the other side has closed (or is in the process of closing) the connection. You...
Read more >What Is a Socket Error? (with pictures) - EasyTechJunkie
The other side of the connection, the second computer or server, cannot be fixed by the person making the socket connection. Common reasons...
Read more >Hardhat deploy script on RSK throws UND_ERR_SOCKET
npx hardhat run scripts/deploy.js --network rsk SocketError: closed at Socket. ... It happens on two different synced local RSKJ nodes, ...
Read more >How to solve "An existing connection was forcibly closed by a ...
SocketException (10054): An existing connection was forcibly closed by a remote host. at System.Net.Sockets.Socket.
Read more >Socket error 10054 - Connection was reset by the other side!
Sometimes the sessions are closed, the transfer is not completed, sometimes the messages are transferred. I will write below some examples from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks! Tracking down those conditions is hard 😦.
Alright, I will see if I can narrow it down.