Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
import { Socket } from 'socket.io'
import { configuration } from '../../configuration/config.environment.js'
export function getClientAddress(socket: Socket) {
return (
(configuration.server.trustProxy ? socket.handshake.headers['x-forwarded-for']?.toString().split(',')[0] : undefined) || // via proxy
socket.handshake.address || // fallback
socket.conn.remoteAddress // fallback (IPv6)
)
}