Overview
NapCat supports multiple network adapter types for flexible integration with your applications. You can configure servers (where your app connects to NapCat) or clients (where NapCat connects to your app).Adapter Types
HTTP Server
HTTP server adapter that receives OneBot 11 API requests via HTTP POST.Unique identifier for this adapter instance.
Enable or disable this adapter.
Port number to listen on.
Host address to bind to. Use
0.0.0.0 to listen on all interfaces.Enable Cross-Origin Resource Sharing (CORS) for web-based clients.
Enable WebSocket upgrade support on this HTTP server.
Message format:
array (CQ code format) or string.Authentication token. Clients must include this in the
Authorization header or access_token query parameter.Enable debug logging for this adapter.
HTTP SSE Server
HTTP Server-Sent Events adapter for real-time event streaming.Unique identifier for this adapter instance.
Enable or disable this adapter.
Port number to listen on.
Host address to bind to.
Enable CORS support.
Message format:
array or string.Authentication token.
Report messages sent by the bot itself.
Enable debug logging.
WebSocket Server
WebSocket server adapter for bidirectional real-time communication.Unique identifier for this adapter instance.
Enable or disable this adapter.
Host address to bind to.
Port number to listen on.
Message format:
array or string.Report messages sent by the bot itself.
Authentication token.
Force push events even if the client is not ready.
Enable debug logging.
Heartbeat interval in milliseconds.
HTTP Client (Reverse Connection)
HTTP client adapter that posts events to your server.Unique identifier for this adapter instance.
Enable or disable this adapter.
Target URL where events will be posted.
Message format:
array or string.Report messages sent by the bot itself.
Authentication token sent in the
Authorization header.Enable debug logging.
WebSocket Client (Reverse Connection)
WebSocket client adapter that connects to your WebSocket server.Unique identifier for this adapter instance.
Enable or disable this adapter.
Target WebSocket URL to connect to.
Message format:
array or string.Report messages sent by the bot itself.
Reconnection interval in milliseconds when connection is lost.
Authentication token.
Enable debug logging.
Heartbeat interval in milliseconds.
Plugin Adapter
Plugin adapter for custom integrations and extensions.Unique identifier for this plugin adapter.
Enable or disable this adapter.
Message format:
array or string.Report messages sent by the bot itself.
Enable debug logging.
Configuration Examples
Authentication
All adapters support token-based authentication: For Server Adapters (HTTP/WebSocket Servers):- Include token in
Authorizationheader:Authorization: Bearer your-token - Or include as query parameter:
?access_token=your-token
- NapCat includes the token in the
Authorizationheader when connecting to your server
Common Use Cases
Single Application
Use HTTP or WebSocket server:Multiple Applications
Enable multiple adapters:Reverse Connection (NAT/Firewall)
Use client adapters when NapCat can’t accept incoming connections:Notes
- Each adapter can be individually enabled/disabled
- Multiple adapters of the same type can run simultaneously
- Adapter names must be unique across all adapter types
- Debug mode increases log verbosity for troubleshooting
- Heart interval controls keep-alive ping frequency for WebSocket connections
