haxball / haxball-issues

115 stars 43 forks source link

Failed after few hours. #752

Open kaclam opened 5 years ago

kaclam commented 5 years ago

Hi. I have a problem with headless host. I use headless chromium and I hosted my room on vps without remote desktop. Everything is good, but after few hours, players cant joined to my room (firstly trying reverse connection to server, then - failed). I have no idea whats happend

dixtel commented 5 years ago

Any errors in console?

kaclam commented 5 years ago

Is it possible to see console in headless browser?

dixtel commented 5 years ago

Yes, see this post #340

kaclam commented 5 years ago

I tried to do this, but I have errors with public key. Is the other way to host room in headless browser except chromium? I read that is good way to host small room, but my room have a lot of code.

dixtel commented 5 years ago

I hosted room in chromium with ~4500 line of codes and I didn't have any problems. I don't know where you need public key (tell me more about this if you want) but hosting room on headless chrome is very easy.

kaclam commented 5 years ago

Remote debugging didnt show me any errors.

If you have 4500 lines and it works, I think my problem is browser. I install these packages:

sudo apt-get install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Its all about chromium. Should I do something? Install another packages? Another browser?

dixtel commented 5 years ago

First tell me where you have problems. Just install chrome by typing: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb and make headless chrome by typing: google-chrome --headless --remote-debugging-port=9222 https://html5.haxball.com/headless now you can connect to this port by typing: ssh username@yourserver -L localhost:9222:localhost:9222 and now go to your browser and type localhost:9222

saviola777 commented 5 years ago

You could use haxroomie. From e.g. your home directory:

sudo apt-get install git npm
git clone https://www.github.com/morko/haxroomie
cd haxroomie
npm install
npm start -- <token> --room-script ./path/to/myscript.js