dsh-plugin-weapp-gateway 0.8.57 → 0.8.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.mjs +8 -2
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -3816,13 +3816,19 @@ const plugin = {
|
|
|
3816
3816
|
throw error
|
|
3817
3817
|
}
|
|
3818
3818
|
const lanEndpoints = clientRoute === 'tailscale'
|
|
3819
|
-
? [...new Set([
|
|
3819
|
+
? [...new Set([
|
|
3820
|
+
appUrl,
|
|
3821
|
+
...tailscaleUrls.map((url) => normalizePublicUrl(url, req, wsPath)),
|
|
3822
|
+
// 附带局域网候选:同网段启动时可直接秒连,不必等内嵌隧道就绪
|
|
3823
|
+
...(lanListening ? lanWebSocketUrls(options, wsPath, lanBoundPort) : []),
|
|
3824
|
+
])]
|
|
3820
3825
|
.filter((url) => {
|
|
3821
3826
|
try {
|
|
3822
3827
|
const parsed = new URL(url)
|
|
3823
3828
|
const host = parsed.hostname.replace(/^\[|\]$/g, '')
|
|
3824
3829
|
return (parsed.protocol === 'ws:' && isTailscaleIp(host)) ||
|
|
3825
|
-
(parsed.protocol === 'wss:' && /\.ts\.net$/i.test(host))
|
|
3830
|
+
(parsed.protocol === 'wss:' && /\.ts\.net$/i.test(host)) ||
|
|
3831
|
+
isRoutablePrivateEndpoint(url)
|
|
3826
3832
|
} catch { return false }
|
|
3827
3833
|
})
|
|
3828
3834
|
.slice(0, 16)
|