chore: Adds formatting.
Co-authored-by: dess <devessa@users.noreply.github.com>
This commit is contained in:
parent
6cf26da4df
commit
42a6d2ea02
33 changed files with 1235 additions and 1032 deletions
|
@ -1,19 +1,19 @@
|
|||
export type ParameterReturnedValue = {
|
||||
success: boolean,
|
||||
message?: string
|
||||
}
|
||||
export type ParameterReturnedValue = {
|
||||
success: boolean;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
export type ForwardRule = {
|
||||
sourceIP: string,
|
||||
sourcePort: number,
|
||||
destPort: number
|
||||
sourceIP: string;
|
||||
sourcePort: number;
|
||||
destPort: number;
|
||||
};
|
||||
|
||||
export type ConnectedClient = {
|
||||
ip: string,
|
||||
port: number,
|
||||
|
||||
connectionDetails: ForwardRule
|
||||
ip: string;
|
||||
port: number;
|
||||
|
||||
connectionDetails: ForwardRule;
|
||||
};
|
||||
|
||||
export class BackendBaseClass {
|
||||
|
@ -25,12 +25,22 @@ export class BackendBaseClass {
|
|||
constructor(parameters: string) {
|
||||
this.logs = [];
|
||||
this.clients = [];
|
||||
|
||||
|
||||
this.state = "stopped";
|
||||
}
|
||||
|
||||
addConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): void {};
|
||||
removeConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): void {};
|
||||
addConnection(
|
||||
sourceIP: string,
|
||||
sourcePort: number,
|
||||
destPort: number,
|
||||
protocol: "tcp" | "udp",
|
||||
): void {}
|
||||
removeConnection(
|
||||
sourceIP: string,
|
||||
sourcePort: number,
|
||||
destPort: number,
|
||||
protocol: "tcp" | "udp",
|
||||
): void {}
|
||||
|
||||
async start(): Promise<boolean> {
|
||||
return true;
|
||||
|
@ -38,22 +48,27 @@ export class BackendBaseClass {
|
|||
|
||||
async stop(): Promise<boolean> {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
getAllConnections(): ConnectedClient[] {
|
||||
if (this.clients == null) return [];
|
||||
return this.clients;
|
||||
};
|
||||
}
|
||||
|
||||
static checkParametersConnection(sourceIP: string, sourcePort: number, destPort: number, protocol: "tcp" | "udp"): ParameterReturnedValue {
|
||||
static checkParametersConnection(
|
||||
sourceIP: string,
|
||||
sourcePort: number,
|
||||
destPort: number,
|
||||
protocol: "tcp" | "udp",
|
||||
): ParameterReturnedValue {
|
||||
return {
|
||||
success: true
|
||||
}
|
||||
};
|
||||
success: true,
|
||||
};
|
||||
}
|
||||
|
||||
static checkParametersBackendInstance(data: string): ParameterReturnedValue {
|
||||
return {
|
||||
success: true
|
||||
}
|
||||
};
|
||||
}
|
||||
success: true,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue