Hi,
I want to get IP address of Appserver client in progress 11.4 version. How can I do that?
In case of webspeed broker, we can get it using Remote_Addr. Is there any way similar to it to get IP address of an Appserver client?
Thanks in advance.
Can you trust the client?
Update from Progress Community
shilpi.agarwal3373 Hi,
I want to get IP address of Appserver client in progress 11.4 version. How can I do that?
In case of webspeed broker, we can get it using Remote_Addr. Is there any way similar to it to get IP address of an Appserver client?
Thanks in advance.
You received this notification because you subscribed to the forum. To stop receiving updates from only this thread, go here.
Flag this post as spam/abuse.
No, it is not a trusted client. We actually want to know how many hits we get from the same I.P so that we can add that I.P. in blacklist after a certain number of failed attempts to appserver by that client.
Did you trying using remote-host ?
Hi Shilpi,
Do you want this where ? in AppServer ?
If you want this in AppServer then there is a log entry type "Ubroker.License" in Basic label, need to set which will logs information about the clients which are connecting to the AppServer like below.
===============
[17/10/17@20:15:52.100+0530] P-001436 T-C-0001 2 UB License asbroker1,172.16.21.36,1,17/10/17@20:15:50.050+0530,17/10/17@20:15:52.052+0530,00:00:01:634,oelxdev03.bedford.progress.com,null,1,qmgsNcwjC6EvFFutgBBO1Q. (16452)
===============
It will show you ip address of client, hostname of client machine, start and end time of connection etc.
brkrLogEntryTypes=UBroker.Basic,Ubroker.License
brkrLoggingLevel=2
Need to set for the broker.
Thanks,
Arun
here is the code. work on webclient , and progress 4gl
DEF VAR SWAN_IP AS CHAR NO-UNDO.
DEF VAR VLAN_IP AS CHAR NO-UNDO EXTENT 5.
DEF VAR VHOST_NAME AS CHAR NO-UNDO.
DEF VAR VPRIMARY_IP AS CHAR NO-UNDO.
RUN SHARE/GETURL.P (INPUT "http://api.ipify.org", OUTPUT SWAN_IP).
RUN SHARE/GETLANIP.P (OUTPUT VHOST_NAME, OUTPUT VLANIP). ASSIGN VPRIMARY_IP = VLANIP[1].
GetUrl.p
-----------------------------------------------
DEF INPUT PARAM PR-URL AS CHAR NO-UNDO.
DEF OUTPUT PARAM PR-STR AS CHAR NO-UNDO.
DEF VAR hobj AS com-handle no-undo.
CREATE "MSXML2.ServerXMLHTTP" hobj NO-ERROR.
NO-RETURN-VALUE HOBJ:setTimeouts(5000,5000,15000,15000) NO-ERROR.
NO-RETURN-VALUE HOBJ:open("GET", PR-URL, "FALSE") NO-ERROR .
NO-RETURN-VALUE HOBJ:setRequestHeader("Content-Type", "application/x-www-form-urlencoded") NO-ERROR.
NO-RETURN-VALUE HOBJ:SEND(PR-URL) NO-ERROR.
PR-STR = hOBJ:responseText NO-ERROR.
RELEASE OBJECT HOBJ.
GetLanIp.p
----------------------------------------------------------------
USING System.* .
USING System.Net.* .
DEFINE OUTPUT PARAM pr-strMachineName AS CHAR NO-UNDO.
DEFINE OUTPUT PARAM PR-LOCALIP AS CHAR FORMAT "X(12)" NO-UNDO EXTENT 5.
DEFINE VARIABLE ipHost AS IPHostEntry NO-UNDO .
DEFINE VARIABLE ipAddr AS IPAddress NO-UNDO EXTENT .
DEF VAR IX AS INT.
ASSIGN pr-strMachineName = Dns:GetHostName().
ASSIGN ipHost = Dns:GetHostByName(pr-strMachineName).
ASSIGN ipAddr = ipHost:AddressList.
REPEAT IX = 1 TO 5:
PR-LOCALIP[IX] = ipAddr[IX]:ToString() NO-ERROR.
END.
Hikmet Alemdaroglu
hikmetalemdaroglu@gmail.com