Jump to content
McKay Development

Recommended Posts

Posted

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
    })
  })
})

 

  • 11 months later...
Posted

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',
      }),
    });

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...