The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/lib/getClientAddress.ts

11 lines
339 B

import type { ISocketConnection } from '@rocket.chat/core-typings';
export function getClientAddress(connection: Pick<ISocketConnection, 'clientAddress' | 'httpHeaders'>): string {
if (!connection) {
return '';
}
const { clientAddress, httpHeaders } = connection;
return clientAddress || (httpHeaders?.['x-real-ip'] as string);
}