About Event Symbol On HTTP Proxy Request

Use this forum to post questions relating to WinGate, feature requests, technical or configuration problems

Moderator: Qbik Staff

About Event Symbol On HTTP Proxy Request

Postby ken123 » Dec 13 13 5:40 pm

Dear Sir
While I wanna set a range or IP under event tag of proxyRequest in WWW Proxy Server properties
{{Session.ClientIp.InRange(Text Begin,Text End)}}
How to set a range because it always mismatch as a False when I need it returns as a true
e.g.
192,168.0.1, 192.168.0.254
my host is 192.168.0.2 that is within the range but it returns false.
{{Session.ClientIp.InSubnet(Text Network,Text Mask)}}
If I set 19.168.0.0, 255.255.255.0
also returns as false.
ken123
 
Posts: 2
Joined: Dec 13 13 4:59 pm

Re: About Event Symbol On HTTP Proxy Request

Postby adrien » Dec 13 13 7:57 pm

Hi

text needs to be wrapped in quotes if it's a literal value (rather than a variable containing a string).. so you'd use

{{Session.ClientIp.InRange("192.168.0.0", "255.255.255.0")}}

this will evaluate to the text "true" or "false" due to the {{ }} which converts to a string (rather than the boolean values of true and false).

If you're using this in an expression evaluator, or jscript or Luascript item, remove the {{ }}. The symbol button should insert the {{ and }} only where required, and won't be inserting these in script items, only fields where embedded script can be evaluated to compile a string (e.g. what to match in a list etc).

Regards

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland

Re: About Event Symbol On HTTP Proxy Request

Postby ken123 » Dec 16 13 8:56 pm

To: Adrien
Thanks for your guide. I am not good in programming script so I want to use the flow chart way to set up event's ploicy.
(Wingate>Control>event> specifc event dialog) When a drag and drop the" list look up check property" dialog, there are one textfield that I can insert a symbol with the botton. e.g. {{Session.ClientIp.InRange(Text Begin,Text End)}}, one pulldown list that I can select which method can use and one match-value-pane that Ican check against which I type the range of IP or subnet and subnet mask. No matter How I type "192.168.0.0", "255.255.255.0" or 192.168.0.0, 255.255.255.0. It still can't get the result be expected. It's always not match and return false. Can you tell me how to set the value on match -value-pane correctly. For examples, Check that values of : I inserted {{Session.ClientIp.InRange(Text Begin,Text End)}} and match against the range of IP192.168.0.1, 192.168.0.254.
And {{Session.ClientIp.InSubnet(Text Network,Text Mask)}} and match against 192.168.0.0,255.255.255.0

Ken
ken123
 
Posts: 2
Joined: Dec 13 13 4:59 pm

Re: About Event Symbol On HTTP Proxy Request

Postby adrien » Dec 17 13 12:21 am

Hi

InSubnet is a boolean function, so can only have 2 returned values, true (IP is in range) or false (it isn't).

So don't use a list lookup for this. Just use an expression evaluator. Set the contents to

Code: Select all
Session.ClientIp.InSubnet("192.168.0.0","255.255.255.0")


And it has 2 outputs, true and false.

Regards

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland


Return to WinGate

Who is online

Users browsing this forum: No registered users and 16 guests

cron