Page 1 of 1
setting up PokerTH live on my own server
Posted: Fri Apr 30, 2021 4:47 am
by adamtcc
I went to the github page for PokerTH live and followed the instructions to install it on my ubuntu server but I can not get it to work.
I'm not even sure I understand the concept correctly. I have a different ubuntu server running pokerth-server and that works, we can connect to it over the internet and play pokerth together.
I thought installing PokerTH Live and serving it as a webpage on a different machine on my LAN would make the live spectator feature work on the ubuntu server running apache, but first I was getting object error whenever I logged in as a guest, then after adjusting the ports to match in the config.xml file on the pokerth server and fixing the LAN IP in the ./inc/pokerth-live_min.js and ./inc/net/neteventhandler.js on the pokerth-live server I finally got the error message to change to "invalid server" but I can't get any further and I don't really understand websockets and the readme file is too basic for me.
can anyone help?
Thanks,
Re: setting up PokerTH live on my own server
Posted: Sun May 02, 2021 4:57 pm
by sp0ck
adamtcc wrote: ↑Fri Apr 30, 2021 4:47 am
I went to the github page for PokerTH live and followed the instructions to install it on my ubuntu server but I can not get it to work.
I'm not even sure I understand the concept correctly. I have a different ubuntu server running pokerth-server and that works, we can connect to it over the internet and play pokerth together.
I thought installing PokerTH Live and serving it as a webpage on a different machine on my LAN would make the live spectator feature work on the ubuntu server running apache, but first I was getting object error whenever I logged in as a guest, then after adjusting the ports to match in the config.xml file on the pokerth server and fixing the LAN IP in the ./inc/pokerth-live_min.js and ./inc/net/neteventhandler.js on the pokerth-live server I finally got the error message to change to "invalid server" but I can't get any further and I don't really understand websockets and the readme file is too basic for me.
can anyone help?
Thanks,
Hi adamtcc,
sorry for late reply - I'm not at home these days, and my access to the internet is currently limited.
Please check following entries in config.xml:
Code: Select all
<ServerUseWebSocket value="1" />
<ServerWebSocketPort value="7233" />
<ServerWebSocketResource value="" />
<ServerWebSocketOrigin value="" />
Origin is the uri - e.g. /blahfasel (if I'm not wrong now - I did not yet have time to setup our own spec tool).
Try a telnet directly from the server - e.g. telnet localhost 7233 - in order to check if the websocket server is running at all.
Let me know if that works for you.
Regards,
sp0ck
EDIT: Spectator Tool works without ssl only - so it must be ws://
Re: setting up PokerTH live on my own server
Posted: Wed Apr 02, 2025 1:33 am
by w2vy
I have pokerth-server installed from ubuntu 24.04 packages and it runs fine.
I want to also setup pokerth-live but I am having some problem.
What version of node/npm should I use?
I installed npm and have these versions:
$ npm -v
9.2.0
$ nodejs -v
v18.19.1
$ node -v
v18.19.1
When I run nom install I get this message
The package-lock.json file was created with an old version of npm
and it runs for a while and then a number of packages are outdated...
88 vulnerabilities (3 low, 54 moderate, 29 high, 2 critical)
Anyone have updates that work with more updated (and maybe supported) packages?
Should index.html be put under web root ( var/w w w/html) for apache to serve?
Seems obvious, but...
Tom
Re: setting up PokerTH live on my own server
Posted: Wed Apr 02, 2025 4:23 am
by sp0ck
Hi Tom,
you can ignore the vulnerability warnings.
This is how it looks on our current productive server - I guess you won't even need to upgrade npm and nodejs (but in case: use a node version manager like
https://github.com/nvm-sh/nvm instead of the ubuntu deb version of node):
Code: Select all
user@pth:/var/www/pokerth/live$ npm -v
10.7.0
user@pthdev:/var/www/pokerth/live$ node -v
v20.15.1
user@pth:/var/www/pokerth/live$ npm i
npm warn old lockfile
npm warn old lockfile The package-lock.json file was created with an old version of npm,
npm warn old lockfile so supplemental metadata must be fetched from the registry.
npm warn old lockfile
npm warn old lockfile This is a one-time fix-up, please be patient...
npm warn old lockfile
up to date, audited 1162 packages in 13s
97 packages are looking for funding
run `npm fund` for details
88 vulnerabilities (3 low, 54 moderate, 29 high, 2 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
npm notice
npm notice New major version of npm available! 10.7.0 -> 11.2.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.2.0
npm notice To update run: npm install -g npm@11.2.0
npm notice
user@pth:/var/www/pokerth/live$ npm run prod
> pokerth-live@0.1.0 prod
> npm run production
> pokerth-live@0.1.0 production
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
[Browserslist] Could not parse /var/www/pokerth/package.json. Ignoring it.
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
DONE Compiled successfully in 1267ms 6:06:20 AM
Asset Size Chunks Chunk Names
/inc/pokerth-live_min.js 177 KiB [emitted]
styles/styles.css 11.8 KiB 0 [emitted] mix
user@pth:/var/www/pokerth/live$
For your webserver you will propably need to setup a reverse proxy rule, in order to connect to websocket server of PokerTH - because browsers nowadays require ssl, but pokerth websocket is not ssl capable (if you are working on localhost only, you do not need a reverse proxy). Here is what we are doing with nginx webserver - assuming that websocket port is 7233:
Code: Select all
location /pthlive {
proxy_pass http://ws-backend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
upstream ws-backend {
server <your pthserver ip-addres>:7233;
}
... for apache there are equivalent instructions:
https://stackoverflow.com/questions/275 ... y-wstunnel
and
https://stackoverflow.com/questions/388 ... -ws-apache
Should index.html be put under web root ( var/w w w/html) for apache to serve?
Yes - also make sure that .node_modules folder, package.json files and .git folder are unaccessible for webserver requests by using deny rules.
Good luck!

Re: setting up PokerTH live on my own server (off topic but nowhere else fits)
Posted: Wed Apr 02, 2025 4:40 pm
by w2vy
I just noticed that pokerth-server has code for working with sqlite3.
It that something that needs to be enabled?
I was looking at the spectator interface to be able to track game progress and winners.
Is that something I could use sqlite for?
Re: setting up PokerTH live on my own server
Posted: Wed Apr 02, 2025 5:42 pm
by sp0ck
The source code and its dependencies are alway installed for the server and the client as both do use the same code-base. sqlite is used by the the client for the game-logs. Every game-session from the client creates an sqlite database file.
As far as I know, the gameserver itself does not use the sqlite lib at all.
I was looking at the spectator interface to be able to track game progress and winners.
Is that something I could use sqlite for?
Spectator-Tool is very limited in it's features. I doubt you can easyly implement sqlite game logs the way the client does.
Re: setting up PokerTH live on my own server
Posted: Wed Apr 02, 2025 10:19 pm
by w2vy
What I want to get at a minimum is the table results at the end of the game and player placing (at least first and second)
Even a log like each client creates would work, but I would prefer a less free form format.
I may have to break down and write some code...
Should I move this to the 'Feature Request' board?
I tried building the code and ran into some issues...
I am a C programmer (Embedded C 40 yrs) and can muddle through C++
Know PHP/SQL/etc python, learning JS/TS
Tom
Re: setting up PokerTH live on my own server
Posted: Thu Apr 03, 2025 3:59 am
by sp0ck
Hi Tom,
I am not yet sure, which direction to go would be best.
For the start I'd post your build-issues with error logs under installation. I can propably assist you compiling the client on ubuntu 24.04.
EDIT: thanks to contributions the github stable branch got updated. I also updated the Dockerfile which you might take a look at for a clean build on ubuntu 24.04. Check the RUN lines and the comments.
https://github.com/pokerth/pokerth
Re: setting up PokerTH live on my own server
Posted: Fri Apr 04, 2025 1:00 pm
by sp0ck
w2vy wrote: ↑Wed Apr 02, 2025 10:19 pm
Even a log like each client creates would work, but I would prefer a less free form format.
You might modify client code in order to automatically upload specific logs (e.g. if table name matches) to a website. Currently log gets uploaded by user action only (when you want to analyze log on website).
Here is a php example of how to parse sqlite log-file with php on server-side:
https://github.com/pokerth/pokerth_mont ... parser.php