exodus4d / pathfinder_websocket Goto Github PK
View Code? Open in Web Editor NEWWebSockets extension for Pathfinder
Home Page: https://www.pathfinder-w.space
WebSockets extension for Pathfinder
Home Page: https://www.pathfinder-w.space
Hi,
i have limited knowledge in this server setup stuff - especially nginx - so i have no idea on how to install the websockets properly. I hope someone can point me in the right direction, please.
So far i have a local working pathfinder setup (all green, except websockets) on a virtualbox, network bridged debian stretch server called "debian". I can reach it with http://debian in my network.
pathfinder is located in /var/www/pathfinder (pathfinder.conf in /etc/nginx/sites...)
websocket is located in /var/www/pathfinder_websockets (i "git cloned it" and executed composer install, adjusted owner and permissions, no errors)
I can start "php cmd.php" and it seems to be running.
But http://debian/setup can not see it. I guess i am missing some steps.
Is it ok to install the websocket in a new directory in /var/www ?
Do i need another nginx config for the websocket in /etc/nginx/sites...?
Do i need to add something to the pathfinder.conf in /etc/nginx/sites...?
Both of the last?
Matthl
The WebSocket server is working great (client can connect) but I keep having this error "Segmentation fault", which of course crash the websocket server. It seems to happen when a client disconnect.
Any idea of what it could be ?
I'm running into an issue with the testWebSocket failing on the /setup route.
Here's the output of php cmd.php
2017-02-15 05:27:15 Server START ------------------------------------------
PHP Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
PHP Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
Notice: Undefined index: load in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 408
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 409
PHP Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
Notice: Undefined index: task in /home/forge/pathfinder_websocket/app/Main/MapUpdate.php on line 412
It seems to be failing somewhere around here: https://github.com/exodus4d/pathfinder/blob/master/public/js/v1.2.0/app/setup.js#L4222
I added a var_dump( $data )
at app/Main/MapUpdate.php
on line 407 to see what was happening during the test. It returned the first healthCheck
task and proper data but afterwards it looked like it was sending some blank data causing it to fail.
I haven't been able to dive into it too much but wanted to reported in case anyone had ideas.
I recently configured Websockets for my own Pathfinder instance, and immediately upon starting the websocket server from this project, it uses all the CPU on my AWS server (t2.small) even without any incoming connections. For everything else on the server (mysql, php-fpm, nginx, etc.) performance has never been an issue as I have a small number of users.
Because of this, Websockets actually perform worse for me than the fallback Ajax method as the server takes longer to respond to requests.
I initially configured websockets for v.1.2.0, but performed the upgrade process all the way to v.1.2.3 to see if that would help, and it has not (this is what I expected, since it is the websocket server that is the problem, and this project has not changed recently).
Here is the rest of the server information from my /setup page:
If you need any other diagnostic information please let me know.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.