4049_1572836826 Posted March 25, 2023 Report Posted March 25, 2023 Hi, in the future I plan to have more bots in one script they will have functions that will get info from steam pages and I would like to avoid limits. I have made such a solution which works with request.. And I would like to ask if there is another option ? proxy.bot = 'http://xx:xx@xxx:xxx' steamUser.bot = new SteamUser({ httpProxy: proxy.bot }) request.bot = Request.defaults({ forever: true, proxy: proxy.bot }) steamCommunity.bot = new Steamcommunity({ request: request.bot }) steamUser.bot.logOn({ refreshToken: 'xxx' }) steamUser.bot.on('loggedOn', () => { console.log('Logged on!') console.log(steamUser.bot.publicIP) // * to eq proxy IP }) steamUser.bot.on('webSession', (sessionID, cookies) => { steamCommunity.bot.setCookies(cookies) steamCommunity.bot.loggedIn((err, loggedIn) => { if (err) console.log(err) if (loggedIn) console.log('Logged in!') const { request: SCrequest } = steamCommunity.bot SCrequest.get('https://api.ipify.org?format=json', (err, res, body) => { if (err) console.log(err) console.log(JSON.parse(body).ip) // * to eq proxy IP }) SCrequest.get('https://steamcommunity.com/my/profile', (err, res) => { if (err) console.log(err) console.log(res.request.uri.href) // * return /profiles/steamID }) }) }) Quote
Rok Posted February 27 Report Posted February 27 Great, worx for me too, although no way to verify that http went through my proxy? Quote
Rok Posted February 28 Report Posted February 28 Hi @Dr. McKay! I will reward you there for the answer. Is this way correct way of injecting proxy? https://github.com/DoctorMcKay/node-steamcommunity/issues/336 Pasting from github: I'm using proxy with steamcommunity. For login I use steam-session library, and for sending requests to steamcommunity i use this package (steam-community). Is this correct way of injecting proxy? (I know i shouldn't use login from this package, that's why i use steam-session) const community = new SteamCommunity({ request: Request.defaults({ forever: true, proxy: 'http://my-proxy.com', }), }); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.