@clidey/dory 0.24.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,135 +0,0 @@
1
- ---
2
- title: 'WebSocket Playground Demo'
3
- description: 'Interactive WebSocket playground for testing real-time connections'
4
- ---
5
-
6
- # WebSocket Playground Demo
7
-
8
- This page demonstrates the WebSocket playground component with various configuration options and real-time connection testing capabilities.
9
-
10
- ## Basic WebSocket Connection
11
-
12
- <WebSocketPlayground
13
- url="/ws/chat"
14
- title="Basic Chat WebSocket"
15
- description="Connect to a WebSocket server and send/receive messages in real-time"
16
- servers={[
17
- {
18
- url: "wss://echo.websocket.org",
19
- description: "WebSocket Echo Server"
20
- },
21
- {
22
- url: "wss://ws.postman-echo.com/raw",
23
- description: "Postman Echo WebSocket"
24
- }
25
- ]}
26
- />
27
-
28
- ## WebSocket with Subprotocols
29
-
30
- <WebSocketPlayground
31
- url="/ws/protocol"
32
- title="WebSocket with Subprotocols"
33
- description="WebSocket connection with custom subprotocols for specialized communication"
34
- subprotocols={["chat", "v1.0"]}
35
- servers={[
36
- {
37
- url: "wss://echo.websocket.org",
38
- description: "Echo Server with Subprotocols"
39
- }
40
- ]}
41
- />
42
-
43
- ## WebSocket with Authentication
44
-
45
- <WebSocketPlayground
46
- url="/ws/secure"
47
- title="Authenticated WebSocket"
48
- description="WebSocket connection with authentication headers"
49
- authType="bearer"
50
- headers={{
51
- "User-Agent": "Dory WebSocket Client",
52
- "X-Client-Version": "1.0.0"
53
- }}
54
- servers={[
55
- {
56
- url: "wss://echo.websocket.org",
57
- description: "Secure Echo Server"
58
- }
59
- ]}
60
- />
61
-
62
- ## Real-time Chat Example
63
-
64
- <WebSocketPlayground
65
- url="/chat"
66
- title="Real-time Chat"
67
- description="Connect to a chat server and participate in real-time conversations"
68
- subprotocols={["chat.v1", "json"]}
69
- headers={{
70
- "X-Client-Type": "web",
71
- "X-Protocol-Version": "1.0"
72
- }}
73
- servers={[
74
- {
75
- url: "wss://echo.websocket.org",
76
- description: "Chat Echo Server"
77
- }
78
- ]}
79
- />
80
-
81
- ## Testing Instructions
82
-
83
- 1. **Connect**: Click the "Connect" button to establish a WebSocket connection
84
- 2. **Send Messages**: Type messages in the input field and click "Send" or press Enter
85
- 3. **View Messages**: All sent and received messages appear in the message history with timestamps
86
- 4. **Configuration**: Use the tabs to configure headers, subprotocols, and authentication
87
- 5. **Server Selection**: Choose different servers from the dropdown to test various endpoints
88
-
89
- ## Features
90
-
91
- - **Real-time Connection**: Live WebSocket connection with status indicators
92
- - **Message History**: View all sent/received messages with timestamps
93
- - **Custom Headers**: Add authentication and custom headers
94
- - **Subprotocols**: Configure WebSocket subprotocols
95
- - **Multiple Servers**: Easy switching between different WebSocket endpoints
96
- - **Error Handling**: Clear error messages for connection issues
97
- - **Binary Support**: Handles both text and binary messages
98
-
99
- ## Message Types
100
-
101
- The playground supports different message types:
102
- - **Sent**: Messages you send (blue background)
103
- - **Received**: Messages from the server (green background)
104
- - **Error**: Connection or sending errors (red background)
105
- - **System**: Connection status updates (gray background)
106
-
107
- ## Example Messages
108
-
109
- Try sending these JSON messages to test structured data:
110
-
111
- ```json
112
- {
113
- "type": "chat",
114
- "message": "Hello, WebSocket!",
115
- "userId": "user123",
116
- "timestamp": "2024-01-15T10:30:00Z"
117
- }
118
- ```
119
-
120
- ```json
121
- {
122
- "type": "presence",
123
- "status": "online",
124
- "userId": "user123"
125
- }
126
- ```
127
-
128
- ```json
129
- {
130
- "type": "notification",
131
- "title": "Test Notification",
132
- "message": "This is a test notification",
133
- "level": "info"
134
- }
135
- ```