让客户端可以使用wss连接
This commit is contained in:
5
app.js
5
app.js
@ -124,11 +124,6 @@ function setupSocketListeners(socket) {
|
||||
|
||||
// 添加新服务器
|
||||
function addServer(name, address) {
|
||||
// 验证地址格式
|
||||
if (!address.startsWith("http://") && !address.startsWith("https://")) {
|
||||
address = "http://" + address;
|
||||
}
|
||||
|
||||
const newServer = {
|
||||
name,
|
||||
address: address.replace(/\/$/, ""), // 移除末尾的斜杠
|
||||
|
@ -96,7 +96,7 @@
|
||||
<span class="close-modal" id="closeModal">×</span>
|
||||
<h2>添加服务器</h2>
|
||||
<input type="text" id="server-name" placeholder="服务器名称" />
|
||||
<input type="text" id="server-address" placeholder="IP地址或域名 (如: http://localhost:3001)" />
|
||||
<input type="text" id="server-address" placeholder="IP地址或域名 (格式:ws/wss://ip/域名)" />
|
||||
<button class="submit-btn" id="add-server-btn">添加</button>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user