rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: ebola on December 17, 2008, 09:14:03 PM

Title: User-Agent
Post by: ebola on December 17, 2008, 09:14:03 PM
Hi

How would a macro look like that disconnects a User-Agent with name "xyz" imediatelly ?


Thx,
ebola
Title: Re: User-Agent
Post by: JellyFrog on December 28, 2008, 04:45:35 PM
Something like this should work (untested):

{.if|{.header|User-Agent.}=xyz|{.disconnect.}|Aww you  are free to go.}
Title: Re: User-Agent
Post by: rejetto on December 28, 2008, 04:49:31 PM
very close jellyfrog

ALT+F6 and enter

[request]
{.if|{.{.header|User-Agent.}=xyz.}|{.disconnect.}.}



untested as well :D
Title: Re: User-Agent
Post by: JellyFrog on December 28, 2008, 04:57:42 PM
very close jellyfrog

ALT+F6 and enter

[request]
{.if|{.{.header|User-Agent.}=xyz.}|{.disconnect.}.}



untested as well :D

[request]
{.if|{.{.header|User-Agent.}=xyz.}|{.disconnect.}.}

in hfs.events disconnects me ;)

Your User Agent is: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
HFS 2.3 beta (217)

Hm.. is it possible it just listen to:{.header|User-Agent.}? and skip the =xyz?
so it looks like this:
{.if|{.header|User-Agent.}|do something.}
That should return true? Just a thought :)
Title: Re: User-Agent
Post by: ebola on December 28, 2008, 05:16:36 PM
Hi

Thx for your answers.

Sadly this solution disconnects EVERY User-Agent - not only the one I specific.
This is realy weird....


Cheers,
ebola
Title: Re: User-Agent
Post by: JellyFrog on December 28, 2008, 05:18:03 PM
Hi

Thx for your answers.

Sadly this solution disconnects EVERY User-Agent - not only the one I specific.
This is realy weird....


Cheers,
ebola

Yes it does, like I said... I guess rejetto is looking at this right now ;)
Title: Re: User-Agent
Post by: JellyFrog on December 28, 2008, 05:29:03 PM
Oh..found it!
In hfs.events (alt+F6):

[request]
{.if|{.{.header|User-Agent.}=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5.}|{:{.disconnect.}:}.}

Disconnect all browsers with "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5" as user-agent

Disconnect all browsers with "xyz" as user-agent:
[request]
{.if|{.{.header|User-Agent.}=xyz.}|{:{.disconnect.}:}.}
Title: Re: User-Agent
Post by: rejetto on December 28, 2008, 07:03:24 PM
yes, {: :} were missing
Title: Re: User-Agent
Post by: ebola on December 28, 2008, 09:03:04 PM
Thank you so much @JellyFrog :)
Working like a charm.

Thank you for this software @rejetto, too.


good n8,
ebola
Title: Re: User-Agent
Post by: JellyFrog on December 28, 2008, 09:08:56 PM
Thank you so much @JellyFrog :)
Working like a charm.

Thank you for this software @rejetto, too.


good n8,
ebola
No problem :)
Title: Re: User-Agent
Post by: CR1T1C4L on January 12, 2009, 04:17:50 AM
what would this be used for?? may I ask
Title: Re: User-Agent
Post by: maverick on January 12, 2009, 05:13:58 AM
what would this be used for?? may I ask

Read this thread.  It should answer your question on what can be done with HFS event scripts.  -> http://www.rejetto.com/forum/?topic=6154

In the example above in this thread, they are using a HFS event script to disconnect anybody coming to their site with the firefox browser.  Different script could also be used to show a different web page depending on the browser being used. etc.   User agent identifies your browser.  What's your user agent -> http://whatsmyuseragent.com/
Title: Re: User-Agent
Post by: securityguard123 on January 12, 2009, 03:19:39 PM
Hi guys!

I am looking for HTML code forums...
lurking around and absorbing everything I can see and understand...

This one is tough and sure very nice if I'll understand it hehehe!
Title: Re: User-Agent
Post by: Anykeev on January 22, 2010, 01:59:28 PM
Quote
[request]
{.if|{.{.header|User-Agent.}=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5.}|{:{.disconnect.}:}.}

Disconnect all browsers with "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5" as user-agent
It is possible to block certain keywords? For example, block "en-US" only?

PS sorry for my english, translated by google
Title: Re: User-Agent
Post by: Roessi on January 22, 2010, 03:45:31 PM
err sth like this ?

{.if|{.pos|en-Us|{.header|User-Agent.}.}|{:{.disconnect.}:}.}
Title: Re: User-Agent
Post by: Anykeev on January 22, 2010, 06:11:02 PM
Thank you Roessi, it's work  :)