Skip to content

Commit 7fe54cd

Browse files
author
Frank Fiegel
committed
style: apply formating
1 parent 89212da commit 7fe54cd

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/server/ClientManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import debug from 'debug';
22
import { hri } from 'human-readable-ids';
33

4+
import type { TunnelServer } from './TunnelServer.js';
5+
46
import { Client } from './Client.js';
57
import { TunnelAgent } from './TunnelAgent.js';
6-
import type { TunnelServer } from './TunnelServer.js';
78

89
export interface ClientManagerOptions {
910
maxTcpSockets?: number;

src/server/TunnelServer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export class TunnelServer {
2424
});
2525
}
2626

27+
close(): void {
28+
this.server.close();
29+
}
30+
2731
listen(port: number, address?: string): Promise<void> {
2832
return new Promise((resolve) => {
2933
if (address) {
@@ -40,10 +44,6 @@ export class TunnelServer {
4044
});
4145
}
4246

43-
close(): void {
44-
this.server.close();
45-
}
46-
4747
registerHandler(clientId: string, handler: SocketHandler): void {
4848
log('registering handler for client: %s', clientId);
4949
this.handlers.set(clientId, handler);

src/server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export { Client, type ClientOptions } from './Client.js';
22
export { ClientManager, type ClientManagerOptions, type NewClientInfo } from './ClientManager.js';
33
export { createServer, type PipenetServer, type ServerOptions } from './server.js';
44
export { TunnelAgent, type TunnelAgentListenInfo, type TunnelAgentOptions, type TunnelAgentStats } from './TunnelAgent.js';
5-
export { TunnelServer, type SocketHandler } from './TunnelServer.js';
5+
export { type SocketHandler, TunnelServer } from './TunnelServer.js';

src/server/server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import { TunnelServer } from './TunnelServer.js';
1010

1111
const log = debug('pipenet:server');
1212

13+
export interface PipenetServer extends http.Server {
14+
tunnelServer?: TunnelServer;
15+
}
16+
1317
export interface ServerOptions {
1418
domains?: string[];
1519
landing?: string;
@@ -18,10 +22,6 @@ export interface ServerOptions {
1822
tunnelPort?: number;
1923
}
2024

21-
export interface PipenetServer extends http.Server {
22-
tunnelServer?: TunnelServer;
23-
}
24-
2525
export function createServer(opt: ServerOptions = {}): PipenetServer {
2626
const validHosts = opt.domains && opt.domains.length > 0 ? opt.domains : undefined;
2727
const myTldjs = tldjs.fromUserSettings({ validHosts });
@@ -85,7 +85,7 @@ export function createServer(opt: ServerOptions = {}): PipenetServer {
8585
app.use(router.allowedMethods());
8686

8787
// Helper to build response with tunnel port if configured
88-
const buildResponse = (info: { id: string; port: number; maxConnCount?: number }, host: string) => {
88+
const buildResponse = (info: { id: string; maxConnCount?: number; port: number; }, host: string) => {
8989
const url = schema + '://' + info.id + '.' + host;
9090
const response: Record<string, unknown> = { ...info, url };
9191
// If using shared tunnel server, override port and add sharedTunnel flag

0 commit comments

Comments
 (0)