Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1002945 // getClientIP - for web bots, may return two addresses separated by comma (second one is x-forwarded-for)

JavaX fragment (include)

static S getClientIP() {
  ifclass MyHTTPD {
    SS headers = MyHTTPD_headers!;
    if (headers != null)
      ret getClientIPFromHeaders(headers);
  } endif
  ifclass WebSocketHTTPD {
    SS headers = WebSocketHTTPD_headers!;
    if (headers != null)
      ret getClientIPFromHeaders(headers);
  } endif
  ret getClientIP_subBot();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002945
Snippet name: getClientIP - for web bots, may return two addresses separated by comma (second one is x-forwarded-for)
Eternal ID of this version: #1002945/6
Text MD5: d1646db5ab91793b82d92797f598e81a
Author: stefan
Category: eleu / javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-03 02:51:07
Source code size: 346 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 682 / 647
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008737 - directClientIP - for web bots, returns just our direct client
#1008999 - clientIP - synonym of getClientIP - for web bots, may return two addresses separated by comma (second one is x-forwarded-for)
#1011961 - getClientIP_subBot - for web bots, may return two addresses separated by comma (second one is x-forwarded-for)
#1027733 - getHttpdHeaders
#3000382 - Answer for ferdie (>> t = 1, f = 0)