lunel-cli 0.1.89 → 0.1.91
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.
|
@@ -74,5 +74,4 @@ export declare function decodeV2BinaryFrame(data: Uint8Array): {
|
|
|
74
74
|
type: number;
|
|
75
75
|
payload: Uint8Array;
|
|
76
76
|
} | null;
|
|
77
|
-
export declare function buildSessionV1WsUrl(gatewayUrl: string, role: "cli" | "app", channel: "control" | "data", password: string): string;
|
|
78
77
|
export declare function buildSessionV2WsUrl(gatewayUrl: string, role: "cli" | "app", password: string): string;
|
|
@@ -66,14 +66,6 @@ export function decodeV2BinaryFrame(data) {
|
|
|
66
66
|
payload: data.subarray(3),
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
export function buildSessionV1WsUrl(gatewayUrl, role, channel, password) {
|
|
70
|
-
const wsBase = gatewayUrl.replace(/^https:/, "wss:");
|
|
71
|
-
if (!wsBase.startsWith("wss://")) {
|
|
72
|
-
throw new Error("Gateway URL must use https://");
|
|
73
|
-
}
|
|
74
|
-
const query = new URLSearchParams({ password });
|
|
75
|
-
return `${wsBase}/v1/ws/${role}/${channel}?${query.toString()}`;
|
|
76
|
-
}
|
|
77
69
|
export function buildSessionV2WsUrl(gatewayUrl, role, password) {
|
|
78
70
|
const wsBase = gatewayUrl.replace(/^https:/, "wss:");
|
|
79
71
|
if (!wsBase.startsWith("wss://")) {
|
package/dist/transport/v2.js
CHANGED
|
@@ -246,10 +246,11 @@ export class V2SessionTransport {
|
|
|
246
246
|
rx: sodium.from_base64(payload.c2s, sodium.base64_variants.URLSAFE_NO_PADDING),
|
|
247
247
|
tx: sodium.from_base64(payload.s2c, sodium.base64_variants.URLSAFE_NO_PADDING),
|
|
248
248
|
};
|
|
249
|
+
const auth = this.computeHandshakeAuth("server_ready", "cli", sodium.to_base64(keyPair.publicKey, sodium.base64_variants.URLSAFE_NO_PADDING));
|
|
249
250
|
this.sendJsonFrame({
|
|
250
251
|
t: "lunel_v2",
|
|
251
252
|
kind: "server_ready",
|
|
252
|
-
auth
|
|
253
|
+
auth,
|
|
253
254
|
});
|
|
254
255
|
this.markSecure();
|
|
255
256
|
return;
|