webman安装了gatewayworker,websocket怎么配置ssl?

a894890640

问题描述

单独用gatewayworker是没问题的,但是在webman就一直不行,能给下配置的示例吗?

'wss' => [
        'handler'     => Gateway::class,
        'listen'      => 'websocket://0.0.0.0:2443',
        'transport'   => 'ssl',
        'context'    => [
            'ssl' => [
                'local_cert'  => '/etc/nginx/conf.d/ssl/server.pem',
                'local_pk'    => '/etc/nginx/conf.d/ssl/server.key',
                'verify_peer' => false,
            ]
        ],
        'count'       => 2,
        'reloadable'  => false,
        'constructor' => ['config' => [
            'name'            => 'WssGateway',
            'lanIp'           => '127.0.0.1',
            'startPort'       => 2301,
            'pingInterval'    => 70,
            'pingNotResponseLimit'    => 5,
            'pingData'        => '55',
            'registerAddress' => '127.0.0.1:1541',
            'onConnect'       => function(){},
        ]]
    ]
119 1 0
1个回答

Gin

ssl 就走域名了 直接 通过nginx 代理就行
location /wss
{
proxy_pass http://127.0.0.1:8685;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
}

×
🔝