笔记笔记
  • Home
  • AI&ML
  • Example
  • Zoo
  • 关于
⌘ K
Linux
Linux 常用命令
宝塔 反向代理
用宝塔 Supervisor 管理器 启动 Workerman
Workerman wss 宝塔 Apache2.4 配置
linux shell 执行长时间程序挂到后台
OpenSSH
开源掌机
记录
最后更新时间:
Copyright © 2023-2024 | Powered by dumi | GuoDapeng | 冀ICP备20004032号-1 | 冀公网安备 冀公网安备 13024002000293号

TABLE OF CONTENTS

‌
‌
‌
‌

Workerman wss 宝塔 Apache2.4 配置

我测试的是 https://www.workerman.net/workerman-chat 项目。

Workerman 文档:http://doc.workerman.net/315297

properties
# Proxy Config
SSLProxyEngine on
ProxyRequests Off
ProxyPass /wss ws://127.0.0.1:7272/wss
ProxyPassReverse /wss ws://127.0.0.1:7272/wss
php
// 证书是会检查域名的,请使用域名连接
ws = new WebSocket("wss://guodapeng.icu/wss");
ws.onopen = function() {
alert("连接成功");
ws.send('tom');
alert("给服务端发送一个字符串:tom");
};
ws.onmessage = function(e) {
alert("收到服务端的消息:" + e.data);
};

浏览器跑一下这个 js,连接成功了。

Preview
Preview