#How do I get the IP from ws.remoteAddress in Bun.serve?

1 messages · Page 1 of 1 (latest)

icy niche
#

Code:

console.log(ws.remoteAddress.length, new TextEncoder().encode(ws.remoteAddress))

Response:

9 Uint8Array(9) [ 122, 64, 4, 7, 50, 86, 0, 0, 0 ]
#

Absolutely no idea how to get the IP from that ws.remoteAddress element nor the encoded text version

#

Also the docs for it are wrong

#

I'm more than sure it should return a proper string instead of ­{¿V

#

Whatever that may be

icy niche
#

@jolly siren this seems like a documentation issue

#

remoteAddress is the binary adress in text format for whatever reason

jolly siren
#

lol

#

sorry

#

can you file an issue

icy niche