mertushka / haxball.js

🎉 A powerful Node.JS library for interacting with the Haxball Headless Host API
https://github.com/haxball/haxball-issues/wiki/Headless-Host#api
MIT License
33 stars 4 forks source link

HttpsProxyAgent is not a constructor #34

Closed juanigauna closed 6 days ago

juanigauna commented 6 days ago

Im trying create a room by using a proxy and throw me this error:

Instance:

const host = await HaxballJS
const room = host({
        roomName,
        maxPlayers: 12,
        public: show,
        noPlayer: true,
        proxy: "http://190.103.177.131:80",
        token,
})

Error

TypeError: HttpsProxyAgent is not a constructor
    at fi (C:\Users\Juan\Documents\Projects\ignaki-bot\node_modules\haxball.js\src\index.js:494:11)
    at C:\Users\Juan\Documents\Projects\ignaki-bot\src\index.ts:49:18
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\Juan\Documents\Projects\ignaki-bot\src\index.ts:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

I use typescript and nodejs

mertushka commented 6 days ago

It's fixed with the new version v2.2.2, thanks for reporting!