You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A `ConnectionInfo` object describes the connection that was used to make the call, and it is defined as follows:
56
+
57
+
```ts
58
+
exportinterfaceConnectionInfo {
59
+
localAddress?:string|undefined;
60
+
localPort?:number|undefined;
61
+
remoteAddress?:string|undefined;
62
+
remotePort?:number|undefined
63
+
}
64
+
```
65
+
54
66
A `ServerInterceptingCall` has the following API:
55
67
56
68
```ts
@@ -87,6 +99,14 @@ class ServerInterceptingCall {
87
99
* Return the host requested by the client in the ":authority" header.
88
100
*/
89
101
getHost():string;
102
+
/**
103
+
* Return information about the connection used to make the call.
104
+
*/
105
+
getConnectionInfo():string;
106
+
/**
107
+
* Get the auth context for the call.
108
+
*/
109
+
getAuthContext():AuthContext;
90
110
}
91
111
```
92
112
@@ -276,9 +296,14 @@ For consistency with the client interceptors design, interceptors will see un-se
276
296
277
297
The client interceptor design has interceptor lists and interceptor provider lists, and interceptors specified at client construction vs interceptors specified for individual call invocations. In contrast, this design only specifies that an interceptor list can be provided at server construction. Per-call interceptors simply don't make sense on the server side, because there is no reasonable point at which to inject them that wouldn't just act as a regular interceptor. Interceptor providers on the other hand could work on the server, but they are not necessary for basic interceptor functionality. The primary purpose of this design is to solidify the interceptor part of the design. Additional injection points for interceptors could be specified in the future, and the way they interact with each other can be decided at that time.
278
298
299
+
### Optional fields in `ConnectionInfo`
300
+
301
+
The type information for Node indicates that the corresponding fields on the `Socket` class are not guaranteed to be populated, so we cannot guarantee that we can populate them here.
0 commit comments