Trouble getting to OF server

Hei!
I’m using ofxHTTP and ofxJSONRPC to stream a video and some data packed in a Json file:

ofxHTTP::SimpleIPVideoServer videoServer port 3333

ofx::HTTP::JSONRPCServer jsonServer port 3333

Both servers are initialized in the same port, and on setup. Then, on the client side, when the address is then entered, sometimes the video is not shown or the data is not read. And from 10 tries, just a couple of them the client is connected to both of them.
Testing server on a Raspberry Pi 4.

The error on the browser console for the data is:

jquery.jsonrpcclient.js:225 WebSocket connection to 'ws://192.168.1.203:3333/' failed: Error during WebSocket handshake: Unexpected response code: 200

||$.JsonRpcClient._getSocket|@|jquery.jsonrpcclient.js:225|
| --- | --- | --- | --- |
||getSocket|@|jquery.jsonrpcclient.js:51|
||$.JsonRpcClient.call|@|jquery.jsonrpcclient.js:94|
||initConfig|@|main.js:44|
||(anonymous)|@|main.js:37|

While the one for the video is:
192.168.1.203/:32 GET http://192.168.1.203:3333/ipvideo/dual-screen net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)

When starting a single server, the client connection rate is 100% for both, so the main question is:

It’s possible to used both servers on the same port?

Or the server needs to be configured in a special way? I mean inside the addons?

Thanks in advance.

heyho,
it is not possible to have multiple apps listening on the same port, on the same machine/network interface. you will have to use different ports.
Just make sure you dont pick one of the commonly used ones, https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
hope that helps
thomas

Hei! Thanks for the quick answer.
There’s only one OF app running with 1 SimpleIPVideoServer and 1 ofxJSONRPC (on the same port), do you mean that this also it’s no possible?

I have little experience with websockets and servers so these questions maybe very basic.

I’m checking the ports on the chart, thanks again.

yes, each connection has to use a different port.