api/stream: rename getInternalStream to getInternalTunnel

This commit is contained in:
jj 2024-12-16 10:16:48 +00:00
parent 5820736a31
commit e7c2872e40
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -16,7 +16,7 @@ import { createStore } from "../store/redis-ratelimit.js";
import { randomizeCiphers } from "../misc/randomize-ciphers.js"; import { randomizeCiphers } from "../misc/randomize-ciphers.js";
import { verifyTurnstileToken } from "../security/turnstile.js"; import { verifyTurnstileToken } from "../security/turnstile.js";
import { friendlyServiceName } from "../processing/service-alias.js"; import { friendlyServiceName } from "../processing/service-alias.js";
import { verifyStream, getInternalStream } from "../stream/manage.js"; import { verifyStream, getInternalTunnel } from "../stream/manage.js";
import { createResponse, normalizeRequest, getIP } from "../processing/request.js"; import { createResponse, normalizeRequest, getIP } from "../processing/request.js";
import * as APIKeys from "../security/api-keys.js"; import * as APIKeys from "../security/api-keys.js";
import * as Cookies from "../processing/cookie/manager.js"; import * as Cookies from "../processing/cookie/manager.js";
@ -303,7 +303,7 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
return res.sendStatus(400); return res.sendStatus(400);
} }
const streamInfo = getInternalStream(req.query.id); const streamInfo = getInternalTunnel(req.query.id);
if (!streamInfo) { if (!streamInfo) {
return res.sendStatus(404); return res.sendStatus(404);
} }

View file

@ -68,7 +68,7 @@ export function createStream(obj) {
return streamLink.toString(); return streamLink.toString();
} }
export function getInternalStream(id) { export function getInternalTunnel(id) {
return internalStreamCache.get(id); return internalStreamCache.get(id);
} }
@ -124,7 +124,7 @@ export function destroyInternalStream(url) {
const id = url.searchParams.get('id'); const id = url.searchParams.get('id');
if (internalStreamCache.has(id)) { if (internalStreamCache.has(id)) {
closeRequest(getInternalStream(id)?.controller); closeRequest(getInternalTunnel(id)?.controller);
internalStreamCache.delete(id); internalStreamCache.delete(id);
} }
} }