Skip to content

Commit

Permalink
fix: 修复wormhole非常常规路径连接问题
Browse files Browse the repository at this point in the history
将使用固定路径改成替换ws字符串为web实现非通用路径连接
  • Loading branch information
HalcyonAlcedo authored Jul 30, 2024
1 parent 5f667a1 commit 111db95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render/wormhole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export function Wormhole () {
case 'msg': {
const { post, token, WormholeClient } = config.Server.HttpRender
const parsedUrl = new URL(WormholeClient)
const { hostname, port } = parsedUrl
const { hostname, port, pathname } = parsedUrl
const ishttps = WormholeClient.includes('wss://')
const host = `${ishttps ? 'https' : 'http'}://${hostname}${port ? `:${port}` : ''}/web/${data.date}`
const host = `${ishttps ? 'https' : 'http'}://${hostname}${port ? `:${port}` : ''}${pathname.replace(/ws\/(?=[^ws\/]*$)/, 'web/')}${data.date}`
logger.mark(`web渲染器已连接,地址:${host}`)
/** 注册渲染器 */
const rd = new HttpRenderer(host, post, token)
Expand Down

0 comments on commit 111db95

Please sign in to comment.