Messages
A VS Code extension that receives and displays real-time messages from a WebSocket server directly in the output panel.
Features
- Real-time Message Reception: Automatically connects to a WebSocket server and receives messages
- Auto-ping/pong Handling: Automatically responds to ping messages with pong
- Customizable WebSocket URL: Easily configure the WebSocket server URL through VS Code settings or commands
- Clean Message Display: Shows only essential message information (title, content, and URL)
- Auto-activation: Starts receiving messages as soon as VS Code launches
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Messages"
- Click Install
Extension Settings
This extension contributes the following settings:
messages.websocketUrl: Configure the WebSocket server URL (default: built-in server)
Usage
Setting WebSocket URL
- Open Command Palette (Ctrl+Shift+P)
- Search for "设置 WebSocket URL" (Set WebSocket URL)
- Enter your WebSocket server URL
- The extension will automatically reconnect and start receiving messages
Or configure directly in VS Code settings:
- File > Preferences > Settings
- Search for "messages.websocketUrl"
- Enter your WebSocket URL
Viewing Messages
All incoming messages are displayed in the "helloworld" output channel. You can open it via:
- View > Output
- Select "helloworld" from the dropdown
The extension expects JSON format messages with the following fields:
{
"title": "Message Title",
"content": "Message content",
"url": "https://example.com"
}
All fields are optional. Non-JSON messages will be displayed as-is.
Release Notes
0.0.1
Initial release with:
- WebSocket connection support
- Real-time message receiving
- Customizable server URL
- Auto ping/pong handling
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\ on macOS or Ctrl+\ on Windows and Linux).
- Toggle preview (
Shift+Cmd+V on macOS or Shift+Ctrl+V on Windows and Linux).
- Press
Ctrl+Space (Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy!
| |