Relays know IP address, user agents, public keys trying to read/write, websocket request info etc. about clients so joinstr uses below things:
You could also run your own relay for some use cases although its always good to use multiple relays. Use clients that care about privacy and VPN/proxy. If you are running a relay, being anon could be helpful if government agencies have issues with some events being published in the future when nostr gets too big.