Jump to content


Photo
Question

Better hosting for bot

hosting

  • Please log in to reply
4 replies to this topic

#1 Maxim

Maxim

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 28 January 2019 - 08:20 AM

Hi, i have 2 servers and have problem with http and my bot didn't working. So which hosting better for bot and mb have tutorial for setup guide server?



#2 SnaBe

SnaBe

    Member

  • Member
  • PipPip
  • 29 posts
  • LocationDenmark

Posted 28 January 2019 - 11:24 AM

I use Digitalocean myself, either for deployment of web apps and or bots.


Edited by SnaBe, 28 January 2019 - 11:32 AM.


#3 Maxim

Maxim

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 29 January 2019 - 10:47 AM

I use Digitalocean myself, either for deployment of web apps and or bots.

I an used that but hane problem - Error polling for trade offers: Error: socket hang up. Mb you can tell me how check this problem, which rules need in firewall? Or mb have tutorial 



#4 SnaBe

SnaBe

    Member

  • Member
  • PipPip
  • 29 posts
  • LocationDenmark

Posted 02 February 2019 - 05:44 PM

I usually use the one-click NodeJS app that they provide & it always seems to work with no issues. The error you get: Error polling for trade offers: Error: socket hang up, might be a code error and not a server host error.



#5 Maxim

Maxim

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 13 February 2019 - 09:22 AM

I usually use the one-click NodeJS app that they provide & it always seems to work with no issues. The error you get: Error polling for trade offers: Error: socket hang up, might be a code error and not a server host error.

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');
const config = require('./config.js');
let winston = require('winston'); // For logging
const client = new SteamUser();
const community = new SteamCommunity();

let logger =  winston.createLogger({
    transports: [
        new (winston.transports.Console)({
            colorize: true,
            level: 'debug'
        }),
        new (winston.transports.File)({
            level: 'info',
            timestamp: true,
            filename: 'cratedump.log',
            json: false
        })
    ],
});
const manager = new TradeOfferManager({
  steam: client,
  community: community,
  language: 'en'
});

const logOnOptions = {
  accountName: config.username,
  password: config.password,
  twoFactorCode: SteamTotp.generateAuthCode(config.shared_secret)
};

client.logOn(logOnOptions);

client.on('loggedOn', () => {
  logger.info("Logged into Steam");
  client.setPersona(SteamUser.Steam.EPersonaState.Online);
  client.gamesPlayed(740);
});

client.on('webSession', (sessionid, cookies) => {
  manager.setCookies(cookies, (err) => {
    if (err) {
        logger.error('Unable to set trade offer cookies: ' + err);
        process.exit(1); // Fatal error since we couldn't get our API key
        return;
    }
    logger.info("Trade offer cookies set.  Got API Key: " + manager.apiKey);
});
  community.setCookies(cookies);
});

manager.on('pollFailure', (err) => {
    console.log(err);
    logger.error("Error polling for trade offers: " + err);
});



I  use this.







Also tagged with one or more of these keywords: Question, hosting

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users