EdC
EdC

Reputation: 1165

How to setup debugging for a websockets WAMP Thruway client?

The Setup

I have set up a Thruway PHP client that subscribes to a service on a public websocket server. The websocket service publishes a stream of data that is processed and modified by the PHP client as the data comes in.

Their system          My client
----------------      ------------------
Websocket Server  ->  PHP Thruway client

Initially I have tried debugging my client through php error logging and viewing php calculations through the console, however this is tedious when trying to debug tables of information that updates frequently.

I have thought about creating a html client that can output debug data in a graphically more presentable way. This is where I am stuck.

Question

Would it be possible to create a websocket router that connects with the public websocket service? Would it be possible to set up a system as per below?

Their system          My system
----------------      -------------------------------------------
Websocket server  ->  PHP Thruway websocket router -> HTML client

If not possible, is there a better way I can debug my data?

Upvotes: 0

Views: 411

Answers (1)

mbonneau
mbonneau

Reputation: 617

The possibilities are endless.

Most simple for debugging if the logging it too noisy: shut the logger off in the Thruway client:

Logger::set(new NullLogger());

And then use echoes.

The latest commit for Thruway (composer require voryx/thruway:dev-master) has quieted the logger quite a bit also.

You could also publish debug information you need from the client and connect up to the router (websocket server in your description) with your browser client and consume the data using autobahn.

Upvotes: 0

Related Questions