ImVerse Posted April 14, 2021 Report Share Posted April 14, 2021 (edited) 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 April 14, 2021 by ImVerse typo Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted April 14, 2021 Report Share Posted April 14, 2021 There is no timeout for connection attempts because when Steam goes down, it can stay down for a while and we want to be able to reconnect automatically. Add this and you can get some more descriptive output: client.on('debug', (msg) => console.log(msg)); Harry 1 Quote Link to comment Share on other sites More sharing options...
ImVerse Posted April 14, 2021 Author Report Share Posted April 14, 2021 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! Quote Link to comment Share on other sites More sharing options...
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.