A tool for simple testing your socket client via using simple Socket.io server
There are screenshots of main page of Socket-Man and special test page which was used
during development:
Let's assume we develop a front-end application that uses socket connections.
But at the moment we don't have access to server or can't emit events from it to client.
So, how can we imitate incoming socket events for testing purposes?
This is why given tool was created.
With Socket-Man you can:
- send events from server to client via convenient admin shell
- subscribe on any event that client can emit to server
- look over all events with their data and possibility to simply copy content
- save your events for further using
The image is available on Docker Hub, so you can just type:
$ docker run -p 9710:9710 daminort/socket-man
The Admin-shell will be available on localhost:9710
Note. You can choose any port you like as well, for example,
7777
:docker run -p 9710:7777 daminort/socket-man
In this case you need to clone repository:
$ git clone https://github.com/daminort/socket-man.git
$ cd socket-man
$ docker-compose up --build
Note. You can use instead of latter command npm-script:
npm run compose-up
In this case you need to start server and client manually and separately.
Server
will be listening port 9710
meanwhile Client
will start on port 9711
.
Also you can start test page which demonstrate working example.
$ git clone https://github.com/daminort/socket-man.git
$ cd socket-man
$ cd server
$ npm start
$ cd client
$ npm start
$ cd test
$ npm start
Note. You can change server port by editing
.env
files:
server/.env, variableAPP_PORT
client/.env.local, variableREACT_APP_SOCKET_SERVER_PORT
For changing client port you need to edit script
start
inpackage.json
:
"start": "PORT=9711 react-scripts start"