
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A powerful, production-ready framework for building real-time applications with HTTP and WebSocket support.
IOServer combines the speed of Fastify with the real-time capabilities of Socket.IO, providing a unified architecture for modern web applications. Built with TypeScript and designed for scalability, it offers a clean separation of concerns through services, controllers, managers, and watchers.
npm install ioserver
# or
yarn add ioserver
import { IOServer, BaseService, BaseController } from 'ioserver';
// Create a service for real-time functionality
class ChatService extends BaseService {
async sendMessage(socket: any, data: any, callback?: Function) {
// Handle real-time messaging
socket.broadcast.emit('new_message', data);
if (callback) callback({ status: 'success' });
}
}
// Create a controller for HTTP endpoints
class ApiController extends BaseController {
async getStatus(request: any, reply: any) {
reply.send({ status: 'OK', timestamp: Date.now() });
}
}
// Initialize and configure server
const server = new IOServer({
host: 'localhost',
port: 3000,
cors: {
origin: ['http://localhost:3000'],
methods: ['GET', 'POST'],
},
});
// Register components
server.addService({ name: 'chat', service: ChatService });
server.addController({ name: 'api', controller: ApiController });
// Start server
await server.start();
console.log('🚀 Server running at http://localhost:3000');
IOServer provides four core component types for building scalable applications:
Handle WebSocket connections and real-time events.
class NotificationService extends BaseService {
async notify(socket: any, data: any, callback?: Function) {
// Real-time notification logic
socket.emit('notification', { message: data.message });
if (callback) callback({ delivered: true });
}
}
Handle HTTP requests with automatic route mapping from JSON configuration.
class UserController extends BaseController {
async getUser(request: any, reply: any) {
const userId = request.params.id;
reply.send({ id: userId, name: 'John Doe' });
}
}
Provide shared functionality across services and controllers.
class DatabaseManager extends BaseManager {
async query(sql: string, params: any[]) {
// Database operations
return await this.db.query(sql, params);
}
}
Handle background processes, monitoring, and scheduled tasks.
class HealthWatcher extends BaseWatcher {
async watch() {
setInterval(() => {
// Monitor system health
this.checkSystemHealth();
}, 30000);
}
}
const server = new IOServer({
host: 'localhost', // Server host
port: 3000, // Server port
verbose: 'INFO', // Log level
routes: './routes', // Route definitions directory
cors: {
// CORS configuration
origin: ['http://localhost:3000'],
methods: ['GET', 'POST', 'PUT', 'DELETE'],
credentials: true,
},
mode: ['websocket', 'polling'], // Socket.IO transport modes
});
Define HTTP routes in JSON files (e.g., routes/api.json):
[
{
"method": "GET",
"url": "/users/:id",
"handler": "getUser"
},
{
"method": "POST",
"url": "/users",
"handler": "createUser"
}
]
IOServer includes comprehensive testing utilities and examples:
# Run all tests
npm test
# Test categories
npm run test:unit # Unit tests
npm run test:integration # Integration tests
npm run test:e2e # End-to-end tests
npm run test:performance # Performance tests
# Coverage report
npm run test:coverage
A complete chat application example is included in the examples/ directory, showcasing:
cd examples/chat-app
npm install
npm start
Visit http://localhost:8080 to see the chat application in action.
IOServer - Main server classBaseService - Base class for WebSocket servicesBaseController - Base class for HTTP controllersBaseManager - Base class for shared logic managersBaseWatcher - Base class for background watchers// Server management
server.addService(options: ServiceOptions)
server.addController(options: ControllerOptions)
server.addManager(options: ManagerOptions)
server.addWatcher(options: WatcherOptions)
server.start(): Promise<void>
server.stop(): Promise<void>
// Real-time messaging
server.sendTo(options: SendToOptions): boolean
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the Apache-2.0 License - see the LICENSE file for details.
FAQs
Damn simple Fastify & Socket.io server framework with TypeScript support
We found that ioserver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.