Jump to content
McKay Development

user.logOn never resolves when running on VPS


Recommended Posts

Hello, I'm using the steam-user and steamcommunity packages to create a trade bot.

When I run my node program on a VPS, the program fails to login into steam without emitting an errors.

I presume this is because the VPS can't connect to Steam servers? But wouldn't a timeout exception occur?

Here's my code:

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');

var client = new SteamUser();
var logOnOptions = {
  accountName: this.doc.credentials.accountName,
  password: this.doc.credentials.password,
  twoFactorCode: SteamTotp.generateAuthCode(this.doc.credentials.sharedSecret)
}

client.logOn(logOnOptions);

client.on("loggedOn", ()=>{
  console.log("Bot logged in to Steam.");
  client.setPersona(1);
  this.setOnline(true);
});

client.on("error", (err)=>{
  console.error("An error occurred");
  console.error(err);
})

The code logs in on my local machine, even with my personal VPN on.

Both my machine and VPS are in the same country as well.

No output is logged to the console (on the VPS) after 10 minutes. And yes, I've put a console log to ensure logOnOption's properties are defined, and, my code is indeed running!

 

I've looked into the webCompatibilityMode but still no luck.

Edited by ImVerse
typo
Link to post
Share on other sites
Connecting to TCP CM: 162.254.192.100:27019
TCP connection established
Handled message: ChannelEncryptRequest
Channel encrypt request: protocol 1, universe 1, nonce bc0de10cc2a4456ef794c347a                                                                                  6cc2922, 0 remaining bytes
Sending message: ChannelEncryptResponse
Handled message: ChannelEncryptResult
Sending message: ClientLogon
Logon message timeout elapsed. Attempting relog.

Looks to be a timeout error.

I decided to create a new VPS (giving me a new IP) and sure enough, it works now!

Seems like my old VPS was blacklisted from Valve or maybe I had something configured wrong.

Thanks for the help!

Link to post
Share on other sites

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...