栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

配置Apache反向代理以在生产中托管Laravel Echo Server

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

配置Apache反向代理以在生产中托管Laravel Echo Server

终于明白了,这是我的

laravel-echo-server.json

{    "authHost": "https://example-domain.com",    "authEndpoint": "/broadcasting/auth",    "clients": [        { "appId": "xxxxxxx", "key": "xxxxxxxxxxxxxx"        }    ],    "database": "redis",    "databaseConfig": {        "redis": { "port": "6379", "host": "localhost"        },        "sqlite": {}    },    "devMode": true,    "host": "localhost",    "port": "6001",    "protocol": "http",    "socketio": {},    "sslCertPath": "/path/to/ssl/crt/crt.pem", // or .crt    "sslKeyPath": "/path/to/ssl/key/crt.pem", // or .key    "sslCertChainPath": "",    "sslPassphrase": "",    "subscribers": {        "http": true,        "redis": true    },    "apiOriginAllow": {        "allowCors": true,        "allowOrigin": "*",        "allowMethods": "GET, POST",        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"    }}

我如何使用laravel-echo-server.json:

import Echo from "laravel-echo";window.io = require('socket.io-client');// Have this in case you stop running your laravel echo serverif (typeof io !== 'undefined') {  window.Echo = new Echo({    broadcaster: 'socket.io',    host: window.location.hostname,  });}

virtualhost
我的域的SSL中的我的apaxhe配置:

RewriteEngine onRewriteCond %{REQUEST_URI}  ^/socket.io [NC]RewriteCond %{QUERY_STRING} transport=websocket    [NC]RewriteRule /(.*)ws://localhost:6001/$1 [P,L]ProxyPass        /socket.io http://localhost:6001/socket.ioProxyPassReverse /socket.io http://localhost:6001/socket.io


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/397796.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号