web & api: rename stream to tunnel
- updated the endpoint to /tunnel - updated status to tunnel - fixed one incorrectly named error in web
This commit is contained in:
@@ -79,7 +79,7 @@ const request = async (url: string) => {
|
||||
return response;
|
||||
}
|
||||
|
||||
const probeCobaltStream = async (url: string) => {
|
||||
const probeCobaltTunnel = async (url: string) => {
|
||||
const request = await fetch(`${url}&p=1`).catch(() => {});
|
||||
if (request?.status === 200) {
|
||||
return request?.status;
|
||||
@@ -89,5 +89,5 @@ const probeCobaltStream = async (url: string) => {
|
||||
|
||||
export default {
|
||||
request,
|
||||
probeCobaltStream,
|
||||
probeCobaltTunnel,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ enum CobaltResponseType {
|
||||
Error = 'error',
|
||||
Picker = 'picker',
|
||||
Redirect = 'redirect',
|
||||
Stream = 'stream',
|
||||
Tunnel = 'tunnel',
|
||||
}
|
||||
|
||||
export type CobaltErrorResponse = {
|
||||
@@ -34,8 +34,8 @@ type CobaltRedirectResponse = {
|
||||
status: CobaltResponseType.Redirect,
|
||||
} & CobaltPartialURLResponse;
|
||||
|
||||
type CobaltStreamResponse = {
|
||||
status: CobaltResponseType.Stream,
|
||||
type CobaltTunnelResponse = {
|
||||
status: CobaltResponseType.Tunnel,
|
||||
} & CobaltPartialURLResponse;
|
||||
|
||||
export type CobaltSession = {
|
||||
@@ -64,4 +64,4 @@ export type CobaltServerInfoResponse = CobaltServerInfo | CobaltErrorResponse;
|
||||
export type CobaltAPIResponse = CobaltErrorResponse
|
||||
| CobaltPickerResponse
|
||||
| CobaltRedirectResponse
|
||||
| CobaltStreamResponse;
|
||||
| CobaltTunnelResponse;
|
||||
|
||||
Reference in New Issue
Block a user