feat: update link format to use full HTTPS URLs with securl.click domain
Changed the link generation in convertLeaseEntriesToRows to use absolute HTTPS URLs (https://%s.securl.click/) instead of relative paths (/peer/%s), enabling direct clickable links and better integration with external services.
lemon-mint committed
Nov 1, 2025 at 02:32 UTC
7582be20fb79950f9c913c11639adb3803b1c46e
2 files changed
+1
-204
cmd/relay-server/view.go
+1
-1
@@ -354,7 +354,7 @@ func convertLeaseEntriesToRows(serv *portal.RelayServer) []leaseRow {
354
if linkPath == "" || linkPath == "(unnamed)" {
355
linkPath = identityID
356
}
357
- link := fmt.Sprintf("/peer/%s", linkPath)
357
+ link := fmt.Sprintf("https://%s.securl.click/", linkPath)
358
359
row := leaseRow{
360
Peer: identityID,
cmd/webclient/test-websocket.html
deleted
-203
@@ -1,203 +0,0 @@
1
-<!DOCTYPE html>
2
-<html lang="en">
3
-<head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>WebSocket Polyfill Test</title>
7
- <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- max-width: 800px;
11
- margin: 50px auto;
12
- padding: 20px;
13
- }
14
- .status {
15
- padding: 10px;
16
- margin: 10px 0;
17
- border-radius: 4px;
18
- font-weight: bold;
19
- }
20
- .status.connecting {
21
- background-color: #fff3cd;
22
- color: #856404;
23
- }
24
- .status.open {
25
- background-color: #d4edda;
26
- color: #155724;
27
- }
28
- .status.closed {
29
- background-color: #f8d7da;
30
- color: #721c24;
31
- }
32
- #messages {
33
- border: 1px solid #ccc;
34
- padding: 10px;
35
- height: 300px;
36
- overflow-y: auto;
37
- background-color: #f9f9f9;
38
- margin: 10px 0;
39
- }
40
- .message {
41
- padding: 5px;
42
- margin: 5px 0;
43
- border-left: 3px solid #007bff;
44
- background-color: white;
45
- }
46
- .message.sent {
47
- border-left-color: #28a745;
48
- }
49
- .message.received {
50
- border-left-color: #007bff;
51
- }
52
- .message.error {
53
- border-left-color: #dc3545;
54
- background-color: #fff5f5;
55
- }
56
- input, button {
57
- padding: 10px;
58
- margin: 5px;
59
- }
60
- input[type="text"] {
61
- width: 60%;
62
- }
63
- button {
64
- background-color: #007bff;
65
- color: white;
66
- border: none;
67
- cursor: pointer;
68
- border-radius: 4px;
69
- }
70
- button:hover {
71
- background-color: #0056b3;
72
- }
73
- button:disabled {
74
- background-color: #6c757d;
75
- cursor: not-allowed;
76
- }
77
- .controls {
78
- margin: 20px 0;
79
- }
80
- </style>
81
-</head>
82
-<body>
83
- <h1>WebSocket Polyfill Test</h1>
84
-
85
- <div class="controls">
86
- <div>
87
- <label for="wsUrl">WebSocket URL:</label><br>
88
- <input type="text" id="wsUrl" value="ws://localhost:8080/ws" placeholder="ws://localhost:8080/ws">
89
- </div>
90
- <div>
91
- <button id="connectBtn" onclick="connect()">Connect</button>
92
- <button id="disconnectBtn" onclick="disconnect()" disabled>Disconnect</button>
93
- </div>
94
- </div>
95
-
96
- <div id="status" class="status connecting">Not Connected</div>
97
-
98
- <div>
99
- <h3>Messages</h3>
100
- <div id="messages"></div>
101
- </div>
102
-
103
- <div class="controls">
104
- <input type="text" id="messageInput" placeholder="Type a message..." disabled>
105
- <button id="sendBtn" onclick="sendMessage()" disabled>Send</button>
106
- </div>
107
-
108
- <script>
109
- let ws = null;
110
-
111
- function updateStatus(state, text) {
112
- const statusDiv = document.getElementById('status');
113
- statusDiv.className = 'status ' + state;
114
- statusDiv.textContent = text;
115
- }
116
-
117
- function addMessage(text, type = 'received') {
118
- const messagesDiv = document.getElementById('messages');
119
- const messageDiv = document.createElement('div');
120
- messageDiv.className = 'message ' + type;
121
- messageDiv.textContent = `[${new Date().toLocaleTimeString()}] ${text}`;
122
- messagesDiv.appendChild(messageDiv);
123
- messagesDiv.scrollTop = messagesDiv.scrollHeight;
124
- }
125
-
126
- function connect() {
127
- const url = document.getElementById('wsUrl').value;
128
-
129
- try {
130
- updateStatus('connecting', 'Connecting...');
131
- addMessage('Attempting to connect to: ' + url, 'sent');
132
-
133
- ws = new WebSocket(url);
134
-
135
- ws.onopen = function(event) {
136
- updateStatus('open', 'Connected');
137
- addMessage('Connection opened', 'received');
138
-
139
- document.getElementById('connectBtn').disabled = true;
140
- document.getElementById('disconnectBtn').disabled = false;
141
- document.getElementById('messageInput').disabled = false;
142
- document.getElementById('sendBtn').disabled = false;
143
- };
144
-
145
- ws.onmessage = function(event) {
146
- addMessage('Received: ' + event.data, 'received');
147
- };
148
-
149
- ws.onerror = function(event) {
150
- addMessage('Error occurred: ' + (event.error || 'Unknown error'), 'error');
151
- };
152
-
153
- ws.onclose = function(event) {
154
- updateStatus('closed', 'Disconnected');
155
- addMessage(`Connection closed (code: ${event.code}, reason: ${event.reason || 'none'})`, 'received');
156
-
157
- document.getElementById('connectBtn').disabled = false;
158
- document.getElementById('disconnectBtn').disabled = true;
159
- document.getElementById('messageInput').disabled = true;
160
- document.getElementById('sendBtn').disabled = true;
161
- };
162
-
163
- } catch (error) {
164
- addMessage('Failed to create WebSocket: ' + error.message, 'error');
165
- updateStatus('closed', 'Connection Failed');
166
- }
167
- }
168
-
169
- function disconnect() {
170
- if (ws) {
171
- ws.close(1000, 'User initiated close');
172
- }
173
- }
174
-
175
- function sendMessage() {
176
- const input = document.getElementById('messageInput');
177
- const message = input.value.trim();
178
-
179
- if (message && ws && ws.readyState === WebSocket.OPEN) {
180
- try {
181
- ws.send(message);
182
- addMessage('Sent: ' + message, 'sent');
183
- input.value = '';
184
- } catch (error) {
185
- addMessage('Failed to send: ' + error.message, 'error');
186
- }
187
- }
188
- }
189
-
190
- // Allow Enter key to send message
191
- document.getElementById('messageInput').addEventListener('keypress', function(event) {
192
- if (event.key === 'Enter') {
193
- sendMessage();
194
- }
195
- });
196
-
197
- // Log WebSocket implementation being used
198
- window.addEventListener('load', function() {
199
- console.log('WebSocket implementation:', window.WebSocket);
200
- });
201
- </script>
202
-</body>
203
-</html>
\ No newline at end of file