diff --git a/packages/grpc-js/src/server-call.ts b/packages/grpc-js/src/server-call.ts index ccc80a1aa..22e15e1cb 100644 --- a/packages/grpc-js/src/server-call.ts +++ b/packages/grpc-js/src/server-call.ts @@ -37,6 +37,7 @@ export type ServerSurfaceCall = { sendMetadata(responseMetadata: Metadata): void; getDeadline(): Deadline; getPath(): string; + getHost(): string; } & EventEmitter; export type ServerUnaryCall = ServerSurfaceCall & { @@ -109,6 +110,10 @@ export class ServerUnaryCallImpl getPath(): string { return this.path; } + + getHost(): string { + return this.call.getHost(); + } } export class ServerReadableStreamImpl @@ -145,6 +150,10 @@ export class ServerReadableStreamImpl getPath(): string { return this.path; } + + getHost(): string { + return this.call.getHost(); + } } export class ServerWritableStreamImpl @@ -190,6 +199,10 @@ export class ServerWritableStreamImpl return this.path; } + getHost(): string { + return this.call.getHost(); + } + _write( chunk: ResponseType, encoding: string, @@ -259,6 +272,10 @@ export class ServerDuplexStreamImpl return this.path; } + getHost(): string { + return this.call.getHost(); + } + _read(size: number) { this.call.startRead(); }