Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Peer IP Address in Nitrogen

Is is there a built in function in nitrogen framework to get Peer IP address? If not, is there a way to get the IP address of peer which is making to request to Nitrogen App

like image 880
Shree Kavi Avatar asked Nov 15 '22 13:11

Shree Kavi


1 Answers

You can get the remote peer's address using wf_platform:get_peername/0.

@spec wf_platform:get_peername() -> {ok, {Address, Port}} | {error, posix()}
    Address = {N1,N2,N3,N4} | {K1,K2,K3,K4,K5,K6,K7,K8}
    Port = int()
like image 144
Felix Lange Avatar answered Dec 08 '22 09:12

Felix Lange