npm-socketman v0.0.19
SocketMan
Warn: This package has been deprecated in favor of socketman. Please use latest.
This package is a developer tool for monitoring and testing Socket.IO events.
Getting Started
- Download the npm package
npm i socketman
- Add
socketman.io
to the cors property of your Socket.IO server instance - Invoke the setup method using your Socket.IO server instance
const { createServer } = require("http");
const { Server } = require("socket.io");
const { setup } = require("socketman");
const httpServer = createServer();
const io = new Server(httpServer, {
cors: {
origin: ["http://socketman.io"]
}
});
setup(io);
httpServer.listen(3000);
- Navigate to socketman.io socketman.io in your browser
- Use the credentials from the
setup
method to create a connection between the webpage's socket instance and your server
Options
setup(io, options)
namespaceName: string?
auth: {username, password} | false
namespaceName
optional
Default: '/admin'
The name of the namespace which will be created to inteface with socketman.io
auth
mandatory
Default: -
If specifying options, auth is mandatory. Auth can be disabled:
setup(io, {
auth: false
});
Or enabled:
setup(io, {
auth: false
});
Usage
Listen Page
All events will be logged to the Listen page. Here events can be filtered by attributes including:
- Event Name
- Room
- Namespace
- Direction (Incoming, Outgoing, Test Emit)
- Socket ID
Emit Page
Test events on this page. Create an event by providing an event name. Optionally, add any desired payloads or a callback. Payloads must be provided in JSON format; a red indicator will appear on the argument if the JSON is invalid or does not match the user-defined type.
Save an event by giving it a name in the Save or Load Event section of the page and then clicking "Save Event". Saved events are added to local storage. To load an event, select one from the dropdown.
Contributors
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago