
微信小程序
小程序与GatewayWorker建立连接及 apache 配置 https 转发
分享 • 默然 发表了文章 • 1 个评论 • 2946 次浏览 • 2018-03-08 09:30
1、apache 加载 proxy_module ,proxy_wstunnel_module 模块
2、apache 配置 ssl [code]# Proxy Config
SSLProxyEngine on
监听的路径和转发的路径,需要输入https://和最后面的/
ProxyRequests Off
ProxyPass /wss ws://0.0.0.0:8585
ProxyPassReverse /wss ws://0.0.0.0:8585[/code]
3、小程序代码[code]var that = this;
wx.connectSocket({
url: "wss://www.xxx.com/wss"
});[/code]
4、GatewayWorker 代码[code]$gateway = new Gateway('websocket://0.0.0.0:8585', $context);[/code]
原文链接:[url=[url=https://sevming.github.io/Php/wxapp-websocket.html#more]微信小程序 - websockt wss[/url]]微信小程序 - websocket wss[/url]
小程序与GatewayWorker建立连接及 apache 配置 https 转发
分享 • 默然 发表了文章 • 1 个评论 • 2946 次浏览 • 2018-03-08 09:30
1、apache 加载 proxy_module ,proxy_wstunnel_module 模块
2、apache 配置 ssl [code]# Proxy Config
SSLProxyEngine on
监听的路径和转发的路径,需要输入https://和最后面的/
ProxyRequests Off
ProxyPass /wss ws://0.0.0.0:8585
ProxyPassReverse /wss ws://0.0.0.0:8585[/code]
3、小程序代码[code]var that = this;
wx.connectSocket({
url: "wss://www.xxx.com/wss"
});[/code]
4、GatewayWorker 代码[code]$gateway = new Gateway('websocket://0.0.0.0:8585', $context);[/code]
原文链接:[url=[url=https://sevming.github.io/Php/wxapp-websocket.html#more]微信小程序 - websockt wss[/url]]微信小程序 - websocket wss[/url]
小程序与GatewayWorker建立连接及 apache 配置 https 转发
分享 • 默然 发表了文章 • 1 个评论 • 2946 次浏览 • 2018-03-08 09:30
1、apache 加载 proxy_module ,proxy_wstunnel_module 模块
2、apache 配置 ssl [code]# Proxy Config
SSLProxyEngine on
监听的路径和转发的路径,需要输入https://和最后面的/
ProxyRequests Off
ProxyPass /wss ws://0.0.0.0:8585
ProxyPassReverse /wss ws://0.0.0.0:8585[/code]
3、小程序代码[code]var that = this;
wx.connectSocket({
url: "wss://www.xxx.com/wss"
});[/code]
4、GatewayWorker 代码[code]$gateway = new Gateway('websocket://0.0.0.0:8585', $context);[/code]
原文链接:[url=[url=https://sevming.github.io/Php/wxapp-websocket.html#more]微信小程序 - websockt wss[/url]]微信小程序 - websocket wss[/url]