home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 November / PCWorld_2001-11_cd.bin / Software / Topware / Proxomitron / prx4b4c6.exe / Docs / ReadMe.txt < prev   
Encoding:
Text File  |  2001-07-21  |  35.3 KB  |  912 lines

  1. #############################################
  2. Proxomitron Version Naoko-4 BetaFive 
  3. (C) 1999, 2000 Scott R. Lemmon
  4. #############################################
  5.  
  6. This is a beta release of Proxomitron. Please keep in mind that as 
  7. such it may have problems. Even so, this version has reached a high 
  8. level of stability and is nearing a final release.
  9.  
  10. For what's new in this beta version check out the "Changes.txt" file.
  11.  
  12. LEGALESE:
  13.  
  14. This program is a public beta and is licensed free for
  15. individual use. However, being beta, I'd like to discourage
  16. widespread distribution of this version. Software archives
  17. in particular should distribute the most recent  full
  18. release instead.
  19.  
  20. Please keep in mind I make absolutely *no* guarantees of any
  21. kind as to the program's safety, fitness, functionality or
  22. suitability for any given purpose. Also I take no
  23. responsibility for any direct or indirect damages this
  24. program may cause - Use it at your own risk!  This is the
  25. case for all versions of Proxomitron, but being beta this
  26. version is more apt to have serious bugs.
  27.  
  28. New in version Naoko-4
  29.  
  30. Here's a quick list of most new features in Proxomitron.  It may not be
  31. complete since I'm mainly focusing on things that are not necessarily
  32. apparent from the GUI.
  33.  
  34. To Install first make a copy of your current Proxomitron folder then copy
  35. the contents of this zip into the new folder. The default.cfg included with
  36. this version has been updated to use new program features. However if you've
  37. customized your own default.cfg file you may want to merge it into the new 
  38. file then delete any duplicates.  Your original filters will be shown in red
  39. once merged (this will last until the config is reloaded).  Where filters are
  40. duplicated, you'll probably want to keep the new (black) version of any filter
  41. you haven't customized.
  42.  
  43. New features include...
  44.  
  45. * SSL Support
  46. * Matching Blocklist/Include files
  47. * Easy method to block new ads/cookies/pages/etc
  48. * Webpage Source view
  49. * Local file filtering
  50. * URL rewriting/redirecting
  51. * Easier config file loading
  52. * CGI Proxy support
  53. * Easier Proxy password
  54. * Header filter activated proxy control 
  55. * Better access control
  56. * HTTP/1.1 & persistent connection support
  57. * Many enhanced matching commands
  58.  
  59.  
  60. ## Bugs fixed ##
  61.  
  62. * Win NT and 2000 merge filter bug fixed
  63. * Menu icon color bug fixed
  64. * Various matching bugs
  65. * Problems freezing a few .gif files
  66. * Plenty of things I forgot ;-)
  67.  
  68. ## SSL Support ##
  69.  
  70. Proxomitron now supports SSL (secure https) connections.  This comes in two
  71. flavors - SSLeay mode and pass-thru mode.  The HTTP options under the
  72. "settings" dialog control which is used by default.
  73.  
  74.  
  75. SSLeay/OpenSSL mode
  76. -------------------
  77.  
  78. In this mode Proxomitron decrypt incoming data, filters it, then re-encrypts
  79. it before sending it on.  This allows for nearly transparent filtering and
  80. full control over https connections. This feat is accomplished using the
  81. very nice Open Source SSLeay/OpenSSL libraries (not included - see below).
  82.  
  83.   To use this mode Proxomitron must have access to "slleay32.dll" and
  84. "libeay32.dll" which contain all the SSL libraries and all cryptographic
  85. routines. Otherwise "Pass-Thru" mode will be used.
  86.  
  87. ################################################################
  88.  
  89. Because of all the legal and patent problems involved in the USA
  90. with any program that uses encryption, Proxomitron comes with NO
  91. ENCRYPTION CODE WHATSOEVER.  In order to filter SSL connection
  92. you must get a copy of two additional files - "slleay32.dll" and
  93. "libeay32.dll".  These files are part of the SSLeay/OpenSSL
  94. library and contain all the needed routines to do SSL encryption
  95. and decryption. In order to work they should be relatively recent
  96. versions and must be complied with all algorithms needed for
  97. https. I know it's a pain but it's the only safe way I know 
  98. to offer SSL support.
  99.  
  100. The .DLL files can often be found as part of other programs that
  101. use SSL. The open-source "stunnel" application is one example. 
  102. If you can locate a binary distribution of stunnel for Win32 you
  103. should be able to find the two dll's with it. Finding them is the
  104. hard part - once you do, just copy the two files into Proxomitron's
  105. program folder and check "Use SSLeay/OpenSSL" under the "HTTP" 
  106. section of Proxomitron's config dialog.
  107.  
  108. Here's a few URLs where compatible ssleay .dlls could be found 
  109. (at least at one time). However since these are independent sites
  110. with no relation to Proxomitron this could change at any time...
  111.  
  112. http://www.attrition.org/~wrlwnd/crypto/ssl/stunnel/dlls.zip
  113. http://packetstorm.securify.com/crypt/SSL/stunnel/dlls.zip
  114. http://opensores.thebunker.net/pub/mirrors/stunnel/dlls.zip
  115.  
  116. ftp://mike.daewoo.com.pl/pub/stunnel/Win32/ (as separate files)
  117.  
  118. Andras.net is now providing a mirror of the OpenSSL files in Hungary...
  119.  
  120. http://andras.net/tools/ssl/dlls.zip
  121.  
  122.  
  123. NOTE: If anyone wishes to mirror these files and is located
  124.       somewhere legally able to do so please let me know. 
  125.  
  126. OpenSSL is developed by the OpenSSL Project for use in the
  127. OpenSSL Toolkit. (http://www.OpenSSL.org/) which includes 
  128. cryptographic software written by Eric Young (eay@cryptsoft.com).
  129. and includes software written by Tim Hudson (tjh@cryptsoft.com).      
  130.  
  131. (See openssl.txt for the full license)
  132.  
  133. ##################################################################
  134.  
  135.  
  136. Server Certificates And Such:
  137.  
  138. There are some other limitations to this. In order for Proxomitron to
  139. act as a SSL server it must have a "Certificate".  Certificates are
  140. used by web servers to identify themselves to your web browser. They
  141. must be digitally "signed" by a known company like VeriSign or your
  142. browser will generate a warning.
  143.  
  144. Proxomitron's certificate is located in the "proxcert.pem" file.  It's
  145. a self-signed certificate created using SSLeay (if you're familiar
  146. with SSLeay you could create a certificate of your own). As such it
  147. should *not* be considered secure.  However it's only used for the
  148. connection between Proxomitron and your web browser - the connection
  149. between Proxomitron and the remote site *is* secure since it relies on
  150. the site's certificate not Proxomitron's.  Normally the local
  151. connection to your browser never passes outside your PC, so its
  152. security isn't really an issue.  In fact, the only reason to encrypt
  153. it at all is to make your browser think it's connecting directly to a
  154. secure site.
  155.  
  156. This does have a few drawbacks though. When you first visit a secure
  157. site being filtered through Proxomitron, your browser will usually
  158. issue a warning.  This happens for two reasons. First Proxomitron's
  159. certificate won't initially be recognized by your browser (normally
  160. you'll be allowed to add it though). Secondly, Proxomitron's
  161. certificate will not match the name of the site your visiting (since
  162. it can't know that ahead of time).
  163.  
  164. Unfortunately (or perhaps fortunately) these warning are unavoidable
  165. since SSL was intentionally designed to prevent an intermediary from
  166. secretly intercepting your data. Proxomitron *is* intercepting your
  167. data, but under your control.
  168.  
  169. One way around this is to use a sort of "half-SSL" technique. 
  170. Proxomitron lets you specify in a normal non-secure "http://" URL that
  171. you want to make a SSL connection to the actual web server - just write
  172. the URL like so...
  173.  
  174. Original:  https://some.secure.site.com/
  175. New     :  http://https..some.secure.site.com/
  176.  
  177. Change the protocol back to "http://" then add "https.." to the front of the
  178. hostname. This make it so the connection between your browser and
  179. Proxomitron is not encrypted but the connection from Proxomitron to the
  180. final server is! Since the local connection to Proxomitron is usually
  181. confined to your PC alone, this is really no less secure.  However your
  182. browser thinks it's got a normal insecure connection and won't do any
  183. certificate checks. This can also be used to access secure pages from
  184. browsers that may not have https support at all.
  185.  
  186. Also beware that Proxomitron does no certificate checking of it's own! If
  187. you don't trust a website and wish to check that it has a valid certificate
  188. put Proxomitron in "Bypass" mode. This will allow your browser to
  189. validate the site as it normally would.
  190.  
  191. Keep in mind certificates are just used to help insure your actually
  192. connecting to the site you think you are and not some "spoofed" site.
  193. Whether they actually do this or not is debatable. Still,  they have nothing
  194. to do with how encrypted your data is. Many sites (especially smaller ones)
  195. may not be using properly "signed" certificates, but this doesn't mean
  196. you're not secure connecting to them. Really all it means is they didn't
  197. cough up some money for VeriSign's official stamp of approval.  Likewise, a
  198. valid certificate is no guarantee a site won't rip you off - you must still
  199. be careful before trusting a site with sensitive data.
  200.  
  201.  
  202. Pass-Thru mode
  203. --------------
  204.  
  205. This is similar to the support offered by many other proxies. In this mode
  206. SSL data is simply passed to the server without any alteration.  This mode
  207. requires no special cytological support as the data is never decoded. 
  208. However this method also gives little benefit except to allow proxy
  209. switching. Proxomitron will always use pass-thru mode when bypassed, and
  210. when the "Use SSLeay" mode is not enabled (or the SSLeay dll files are not
  211. present).
  212.  
  213.  
  214. ## Proxy Related Stuff ##
  215.  
  216. CGI PROXY SUPPORT:
  217. ------------------
  218.  
  219. Proxies that use a URL prefix can now be used in Proxomitron.  Simply add
  220. the URL to the proxy selector as you would a normal proxy (but the http://
  221. isn't required). The only restriction is that the proxy must work by tacking
  222. the destination URL to the end.  For example, if the proxy was...
  223.  
  224. http://somehost.com/cgi-bin/proxy.cgi/
  225.  
  226. and you were connecting to...
  227.  
  228. http://anotherhost.com/some/webpage.html
  229.  
  230. Then Proxomitron will automatically form...
  231.  
  232. somehost.com/cgi-bin/proxy.cgi/http://anotherhost.com/some/webpage.html
  233.  
  234. While a DeleGate style proxy might look like...
  235.  
  236. www.delegate.com:8080/-_-
  237.  
  238. and form...
  239.  
  240. www.delegate.com:8080/-_-http://anotherhost.com/some/webpage.html
  241.  
  242. Just like in a web browser multiple CGI style proxies can be chained by
  243. simply combining them together...
  244.  
  245. somehost.com/cgi-bin/proxy.cgi/http://www.delegate.com:8080/-_-http://anotherhost.com/some/webpage.html
  246.  
  247. CHAINING REGULAR A PROXY TO CGI PROXIES:
  248. ----------------------------------------
  249.  
  250. In addition to CGI proxies it's also possible to chain a regular proxy to the
  251. start of the list.  This is the equivalent of using a normal proxy in your
  252. browser while also using a CGI proxy.  The syntax for this is to use '->'
  253. like so...
  254.  
  255. www.aproxy.com:8080->somehost.com/cgi-bin/proxy.cgi/
  256.  
  257.  
  258. ## Block List Files ##
  259.  
  260. Proxomitron now supports block lists. Most often they'll contain lists of
  261. URLs to use with a filter. 
  262.  
  263. Actually "block list" is a bit of a misnomer though, since they can do much
  264. more than just block. In fact, they're really an extension of the normal
  265. matching expressions. A block list is a simply a text file containing a list
  266. of matching items.  Each line in the list is checked until a match is found
  267. - otherwise the list returns false. Every block list file has a name (in the
  268. settings dialog), and can be included at any point in a matching expression
  269. by using "$LST(listname)". Most often this will be used in a filter's the
  270. URL match, but it's not limited to URLs alone.  A list can contain any
  271. matching commands - even calls to other lists!
  272.  
  273. You can also add "exclude" lines By prefixing a line with the '~' character.
  274. They can be used to limit what a list will match, and are only checked if a
  275. regular match is found first in the list. The list will return as true only
  276. if *none* of the exclude lines match.
  277.  
  278. Lists can also be called in the replacement text.  Here they're not really
  279. used to match anything but instead are used to set a positional variable to
  280. some value.  By using the $CON(#,#) matching command, replacement text
  281. variables can be rotated based on the connection number (like multiple
  282. User-Agents or browser versions for instance). 
  283.  
  284. You can have up to 255 different lists and use them in any way you like. 
  285. Common uses could include URLs to kill, sites to accept cookies from, pages
  286. to disable or enable JavaScript on, etc.  Once set up to use a list, an "Add
  287. to blockfile" option on Proxomitron's system tray menu makes adding new URLs
  288. to a list fairly easy. Just copy a URL to the clipboard and it'll be
  289. auto-pasted into the dialog.
  290.  
  291. Normally, each line in a list is treated as an independent matching
  292. expression. However long expressions can be broken up over multiple lines
  293. by indenting the lines that follow. For example...
  294.  
  295. taste (this|that|these|those|the other thing)
  296.  
  297. could also be written as....
  298.  
  299. taste (
  300.   this|
  301.   that|
  302.   these|
  303.   those|
  304.   the other thing)
  305.  
  306. The effect is exactly the same, but you can break long lines up for easier
  307. reading - leading or trailing whitespace on each line will be ignored.
  308.  
  309. List can contain comments by beginning a line with '#'. Comments normally
  310. will be ignored, but the first few lines of a list are scanned for certain
  311. "keywords" which can affect how the list works.  Currently there are five
  312. keywords "NOADDURL", "junkbuster", "NoHash", "NoUrlHash", and "NoPreHash".
  313.  
  314. "NOADDURL" hides the list from the "Add to blockfile" menu. It's useful to
  315. keep it from becoming cluttered by lists not used for URL matches.
  316.  
  317. "JunkBuster" if found, will cause Proxomitron to attempt to read and
  318. interpret the list as a JunkBuster style blockfile.  It's probably less than
  319. perfect, but seems to work fairly well with most JunkBuster lists.
  320.  
  321. Note that due to differences in methodology, designing your own list by
  322. adding URLs as you find them will likely be more efficient.  In particular,
  323. JunkBuster processes hostnames in reverse (root first).  Proxomitron treats
  324. a URL the same as any random text, so you're better off not using an initial
  325. wildcard. For instance, "(www.|)somehost.com" will be much faster than
  326. "*somehost.com".  If you need a leading wildcard try "[^/]++somehost.com".
  327. It's a little better than '*' since it only scans up to the first "/" in the
  328. URL.
  329.  
  330. "NoHash", "NoUrlHash", and "NoPreHash" are used to disable various hashing 
  331. algorithms used in lists.  NoHash eliminates all hashing and can same memory
  332. for list that are seldom called or where speed isn't an issue. "NoUrlHash"
  333. and "NoPreHash" disable particular hash types (see below). You probably
  334. shouldn't need to use these very often (if at all).
  335.  
  336.  
  337. ## Blocklist Indexing (hashes) ##
  338.  
  339. Proxomitron can now do an indexed hash lookup on eligible list entries.
  340. This makes finding matches in large lists *much* faster.  Normally you
  341. don't need to worry much about how this works, but if you want to
  342. guarantee your blocklist will be as fast as possible here's some tips...
  343.  
  344. First, not all list entries can be hashed. Proxomitron checks each item in
  345. the list to see if it's hashable.  If so, it's added to a hash list - if not,
  346. it's added to a non-hashable list that must be scanned each time the list
  347. is checked. Of course, it's better to be hashable.
  348.  
  349. There's two types of indexes Proxomitron can use - a fixed prefix and a
  350. URL style index.  Each item in the list is checked to see if it can be
  351. indexed using either method, if so the method that can index the most
  352. characters is used for that item. The total list may have mixture of both
  353. types.
  354.  
  355. "fixed prefix" are the simplest - they're just any expression that has a
  356. fixed number of characters without any wildcards. The longer the prefix is
  357. before any wildcard, the more indexable it becomes. Most user added URLs
  358. probably fall into this category, but it benefits many non-URL based lists
  359. too.  Here's a few examples of eligible expressions...
  360.  
  361.   www.somewhere.com
  362.   127.0.0.
  363.   shonen(kinfe|)
  364.   foo(bar|bat)*bear
  365.  
  366. ANDs are fine too as in "this*&*that" - however ORs outside of parens like
  367. "this|that" won't index since the match can begin with two different
  368. values. In this case it's better to place each on its own line.
  369.  
  370. URL matches are designed to allow some leading wildcards to be used.  It
  371. works by looking in the expression for the end of the hostname (marked by
  372. a ":" or "/") and indexes back from there.  For it to work there must be
  373. no other wildcards between the hostname's end and the leading wildcard.
  374. Valid wildcards include "*", "\w", "[...]+", "[...]++", and "(...|)". 
  375. This should cover the most useful ones for leading off URLs.  Again here's
  376. some examples...
  377.  
  378.   *somehost.com/(anything|after|here|is|fine)/\w.html
  379.   \wsomehost.com/
  380.   [^.]+.somehost.com/
  381.   [^/]++somehost.com/
  382.   (www.|)somehost.com:[0-9]+/
  383.   ([^/]++.|)somehost.com/
  384.  
  385. Unfortunately things like...
  386.  
  387.   ([^/]++.|)somehost.*/
  388.   ([^/]++.|)somehost.(com|net)/
  389.  
  390. won't be indexable.  In these cases it may actually be faster to write
  391. them as two entries...
  392.  
  393.   ([^/]++.|)somehost.com/
  394.   ([^/]++.|)somehost.net/
  395.  
  396. One change blocklist authors should take note of is, when using a leading
  397. wildcard, it's very important to use the full hostname including the "/". 
  398. Previously this wasn't necessary, so an entry like...
  399.  
  400.   [^/]++.|)microsoft.
  401.  
  402. would be better written as...
  403.  
  404.   [^/]++.|)microsoft.com/
  405.  
  406. or perhaps multiple entries if necessary.   It also means there's less of
  407. a need to write expressions like...
  408.  
  409.   www.(ad(server|engine|banner)|banner(site|click|)).(com|net)
  410.  
  411. Instead, listing all the actual hosts to be matched will be faster - not
  412. to mention easier to maintain.
  413.  
  414. ## URL: type header filter ##
  415.  
  416. When designing a header filter the header "URL:" now has special
  417. meaning. Although not an actual header, it can be used to filter
  418. the URL itself - taking some action based on the URL alone or
  419. redirecting the URL to a new location.
  420.  
  421. When you use "URL: [description]" as a header's name the
  422. "matching" section like the "URL" section will match against the
  423. URL itself.  The only difference being the "matching" section
  424. includes the "http://" or "https://" portion in the match. 
  425.  
  426. To redirect the URL the replace section can include a $JUMP or
  427. $RDIR command (see below) which can include portions of the
  428. original URL captured into positional variables.  Take for
  429. example....
  430.  
  431.   Out = "True"
  432.   Key = "URL: MS Redirect"
  433.   Matching="http://www.mirosoft.com/\0"
  434.   Replace="$RDIR(http://www.microsloth.com/\0)"
  435.  
  436. This would invisibly redirect any URL going to "microsoft" to
  437. "microsloth" instead! Rather than creating a filter for every
  438. redirection, It's also possible to use the list "$LST(Listname)"
  439. function to create a list of redirections. Take a filter like the
  440. following...
  441.  
  442.   Out = "True"
  443.   Key = "URL: Redirect List"
  444.   Match = "http://$LST(RedirectList)"
  445.  
  446. or just...
  447.  
  448.   Out = "True"
  449.   Key = "URL: Redirect List"
  450.   URL = "$LST(RedirectList)"
  451.  
  452. "RedirectList" could then point to a text file containing the
  453. following....
  454.  
  455.   #
  456.   # Proxomitron Redirection List
  457.   # NOADDURL
  458.   #
  459.  
  460.   ms/ $JUMP(http://www.microsoft.com/)
  461.   sd/ $JUMP(http://www.slashdot.org/)
  462.   mail/ $JUMP(http://my.email.site.com/)
  463.  
  464. This, in effect, sets up a list of "aliases" for sites you visit
  465. often. You could then enter only "mail" in your browser to go to
  466. your email page for instance.
  467.  
  468. Another use would be to redirect know advertisers to an image of
  469. your choosing. For instance...
  470.  
  471.   Out = "True"
  472.   Key = "URL: Spam Redirect"
  473.   Match = "http://$LST(SpamList)"
  474.   Replace = "$RDIR(http://file//C:/images/spam.gif)"
  475.  
  476.  
  477. The "SpamList" could then contain...
  478.  
  479.   #
  480.   # Proxomitron Anti-Spam List
  481.   #
  482.  
  483.   www.doubleclick.net
  484.   [a-z]+.flycast.com
  485.  
  486. and so on....
  487.  
  488.  
  489. ## URL commands ##
  490.  
  491. When requesting a page in your browser, it's now possible to embed certain
  492. commands in any URL to make it perform some additional function in
  493. Proxomitron. Commands are tacked onto the start of the hostname separated by
  494. either two dots '..' or two slashes '//'.  
  495.  
  496. http://command..www.host.com/rest/of/url.html
  497.  
  498. Here's a list of the current commands...
  499.  
  500. http://file//path
  501.     Used to filter a local file as if it were a web page. Similar to
  502.     the file:// URL used by most browsers.
  503. http://bypass..www.host.com/some/webpage
  504.     Use to bypass filtering for a specific URL only.
  505. http://bout....www.host.com/some/webpage
  506.     Bypass outgoing header filters only
  507. http://bin..www.host.com/some/webpage   
  508.     Bypass incoming header filters only
  509. http://bweb..www.host.com/some/webpage
  510.     Bypass only the web filters 
  511. http://https..www.host.com/some/secure/webpage
  512.     Use to load a 'secure' https: web page without having the local page
  513.     encrypted. Can be use to access secure pages from browsers that don't
  514.     directly support https, or to avoid the normal https warning messages
  515.     a browser may spit out. The actual remote connection is still encrypted,
  516.     but Proxomitron sends the decrypted and filtered page to your browser.
  517.     Note: requires SSLeay/OpenSSL .dll files to work.
  518. http://src..www.host.com/some/webpage
  519.     Displays the *true* source of any web page
  520.     (unaffected by JavaScript commands or dynamic HTML).
  521.     Useful when the browser won't let you see the source
  522.     or dynamic HTML alters it.
  523. http://dbug..www.host.com/some/webpage
  524.     Displays the source like "src.." but also cause debug information to
  525.     be included showing what text each web filter matched.  Similar to 
  526.     turning on the "HTML Debug Info" option in the log window.
  527. http://load//filename?url
  528.     Used to load a Proxomitron config file.  Path points to
  529.     the file to load. It can optionally be followed by a '?'
  530.     and a URL to go to once the config has been loaded.  If the config
  531.     is within the Proxomitron directory, it's not necessary to
  532.     type the full path...
  533.    
  534.     http://load//default.cfg?http://www.microsoft.com/
  535.  
  536. It's also possible to string multiple URL commands together as in...
  537.     http://src..bypass..www.host.com/some/webpage
  538.  
  539.  
  540. ## New matching codes  ##
  541.  
  542. + -  The run matching command has been changed slightly.  It will now
  543.      match 0 or more of a given expression (instead of 1 or more). 
  544.      You can use it with brackets to enforce minimum number of matches
  545.      if needed like so...  
  546.      a+{1,*}
  547.      Will match 1 or more a's
  548.  
  549.  
  550. ++ - Like '+' will match a run of items, but '++' will only match
  551.      up to the point where what follows is true. It works very
  552.      much like '.*' does in UNIX style regexps
  553.     
  554. Examples:  "[^ >]++"   will work similar to "\w"
  555.            "[a-z]++boat"  given the word "lifeboat" will
  556.            match only "life" (while "[a-z]+" would match
  557.            all of "lifeboat")
  558.           
  559. {min,max} or {exact number} or {min,*}
  560.  
  561. Either '+' or '++' can now be followed by brackets to limit the number of
  562. repetitions matched. For example, "?+{6}" will match six characters while
  563. "?+{6,12}" needs at least 6 characters to match but will match no more than
  564. 12 characters.  '*' can be used for no max as in "foo++{6,*}bar" needs at
  565. least six "foo"s to  match but can have more. 
  566.  
  567. [#x:y] or [#x]
  568.  
  569. The numeric match can now test for negative numbers. In this case
  570. use ':' instead of '-' to separate the numbers.  For instance
  571. "[#-400]"  will match negative 400 exactly.
  572. "[#-100:-50]" will match any number between -100 and -50
  573. "[#-500:500]" will match any number between -500 and +500
  574.  
  575.  
  576. && - Double ANDs 
  577.  
  578. Using two ANDs in a row works similar to using one and except the match
  579. that follows will be limited to only matching what matched before the AND.
  580.  
  581. Confused? Don't be - it's really quite simple. It works like a mini-bounds
  582. you can use to further restrict the scope within a match. Consider
  583. the following...
  584.  
  585.   (<img*>&&*width=[#20]*)
  586.  
  587. This will match any image tag that has a width of 20.  The double ANDs
  588. limit the check for the width tag to just whatever "<img*>" matches. If we
  589. did this using the onld single AND like so...
  590.  
  591.   (<img*>&*width=[#20]*)
  592.  
  593. Then a line like...
  594.  
  595.   <img src=foo > width=20
  596.  
  597. would also match (since we do have both "<img*>" and "*width=20*"),
  598. but this probably isn't what we want.
  599.  
  600.  
  601. ## The Replacement Stack (\# and \@ commands) ##
  602.  
  603. Normally Proxomitron supports ten matching variables \0 to \9. In most
  604. cases this works fairly well, but what if you want to match each iteration
  605. of a matched run?  For example, say you had a filter that broke a URL into
  606. segments divided by the "/" character.  You could do this with a match like
  607. so...
  608.  
  609. http://(*/)+
  610.  
  611. However, up till now there's been no way to capture each segment into a
  612. *different* variable. this is where the replacement stack comes in.  It
  613. uses the special character "\#" which like "\0" through "\9" stores a
  614. matched value.  However each time it's called it stores the matched value
  615. into a "stack" which can hold up to 20 items. It can then be used in the
  616. replacement text to "pop" an item off that stack in a first-in first-out
  617. manner.  Using this we could write the above match like so...
  618.  
  619. "http://(\#/)+\#"
  620.  
  621. Given a replacement text of...
  622.  
  623. "\# \# \# \# \# \# \#"
  624.  
  625. It would convert this...
  626.  
  627. "http://this/is/a/test/of/the/stack.html"
  628.  
  629. into this...
  630.  
  631. "this is a test of the stack.html"
  632.  
  633. Each iteration of the (...)+ run pushes a different value onto the stack,
  634. then whatever's left over gets matched by the final "\#".
  635.  
  636. Like the other positional variables, the stack variable can be used
  637. directly after a set of parens to capture the expression within.  For
  638. instance...
  639.  
  640. "http://(*/)\#+\#"
  641.  
  642. would produce...
  643.  
  644. "this/ is/ a/ test/ of/ the/ stack.html"
  645.  
  646. The replacement text also recognizes another special escape "\@".  This
  647. just dumps the entire contents of the stack in order (like using
  648. \#\#\#\#\#\#\#\#...). 
  649.  
  650.  
  651. ## New matching commands ##
  652.  
  653. An extensible syntax for matching subroutines has been added to Proxomitron.
  654. All these commands begin with "$" followed by the command name, a "(", any
  655. command parameters, finally ending with ")".  All commands must be upper
  656. case to help reduce possible conflicts.  Usually it's not necessary to
  657. escape the "$" when matching unless it would conflict exactly with an
  658. existing command. A command can also optionally be followed by a ';' but
  659. this isn't required and is purely to appease us 'C' folk.
  660.  
  661. Generally matching functions are designed to be used in the "matching"
  662. portion of a filter, but a few like $JUMP and $LST may also be used in a 
  663. filter's replacement text.
  664.  
  665. $CMD(parameter values)
  666.  
  667.  
  668. $AV(match)
  669.  
  670. This is used to match any attribute's value.  It first parses and isolates
  671. the value - automatically taking things like quotes vs. no quotes into
  672. account.  The match within the command is then limited to just the
  673. attribute value.  Note: Any quotes surrounding the value will not be part
  674. of the match. 
  675.  
  676. For example, to match any image with the word "Gargalishous!" in
  677. the alt tag, you could use...
  678.  
  679.   <img * alt=$AV(*gargalishous!*) *>
  680.  
  681. which would work for any of the following...
  682.  
  683.   <img src="foo" alt="My is this trout ever Gargalishous!">
  684.   <img src="foo" alt='Gee your hair is Gargalishous! Is that bison flavor?'>
  685.   <img src="foo" alt=JustRawGargalishous! >
  686.  
  687. Even though the match doesn't include the quotes, they'll still be
  688. consumed by the command. This means if you want to capture the entire
  689. value including quotes you could use a match like...
  690.  
  691.   <img * alt=($AV(\1))\2 *>
  692.  
  693. Here \2 will contain the full tag with its original quotes, while \1 will
  694. just contain the raw value itself. For example given...
  695.  
  696.  <img src="foo" alt="Move all Zig!">
  697.  
  698.  \1 = Move all Zig!
  699.  \2 = "Move all Zig!"
  700.  
  701. But there's also another way to do this - just use $AVQ()
  702.  
  703.  
  704. $AVQ(match)
  705.  
  706. This is exactly like $AV(...) except it also includes any quotes in
  707. the match.  Useful when you just want to capture an attribute's value
  708. like so...
  709.  
  710.   <img * alt=$AVQ(\1) * >
  711.  
  712. which would capture any alt value into \1.
  713.  
  714.  
  715. $LST(blockfile)
  716.  
  717. Is used to include a blockfile in any matching expression.  The contents of
  718. the blockfile are tested line by line against the text to be matched until a
  719. match is found. Otherwise the expression returns false.
  720.  
  721.  
  722. $SET(#=value)
  723.  
  724. Use to set a positional variable to a specific value.  Any replacement text,
  725. including other variables, can be set entered here.
  726.  
  727. Example: set variable 1 equal to "foobar"
  728.          $SET(1=foobar)
  729.          Set variable \1 to print the contents of \2
  730.          $SET(1=Two is \2)
  731.  
  732. By placing $SET commands within a matching expression, you can set various
  733. values *only* if the matching expression reaches that point. This can be
  734. used for an if/then/else effect...
  735.  
  736. match: name=(one $SET(0=Naoko) | two $SET(0=Atsuko) |
  737.              three $SET(0=Michie) | $SET(0=Default))
  738.  
  739. replace: "\0 Matched"
  740.  
  741. will produce the following results...
  742.  
  743. if name=one   -> "Naoko Matched"
  744. if name=two   -> "Atsuko Matched"
  745. if name=three -> "Michie Matched"
  746. else          -> "Default matched"
  747.  
  748.  
  749. $CON:(x,y[,z])
  750.  
  751. Will be true only if the current connection number is 'x' of 'y' (optionally
  752. for every 'z' connections). Use to rotate values based on connection. The
  753. following for example will rotate between three values in \0 ...
  754.  
  755. ($CON(1,3) $SET(0=Value one of three)|
  756.  $CON(2,3) $SET(0=Value two of three)|
  757.  $CON(3,3) $SET(0=Value three of three))
  758.  
  759. use the 'z' option to delay the rotation to every so many connections.
  760.  
  761.  
  762. $IHDR(header-name:matching)
  763. $OHDR(header-name:matching)
  764.  
  765. Can be use to test the value of any HTTP header. The command will be true
  766. only if the named header's value matches the 'matching' section. $OHDR test
  767. outputed headers while $IHDR tests incoming headers. For example this will
  768. only match is the "Referer" header contains 'microsoft.com'
  769.  
  770. $OHDR(Referer:*.microsoft.com)
  771.  
  772. Using these you can have web filter only match if specific header values are
  773. also true, or to capture and use header values into a variables to use in a
  774. filter's replacement.  You can use also them in HTTP header filters to check
  775. combinations of headers for a match.
  776.  
  777. $URL(matching)
  778.  
  779. This can be used to test the URL inside the matching portion of a filter.  
  780. Normally you would use the filter's URL match for this, but by using this
  781. command you can check for different URL based on the text matched. It's also
  782. useful to capture portions of a URL into variables.  The following would
  783. capture the URL's path...
  784.  
  785. $URL(www.somehost.com/\1)  
  786.  
  787. As elsewhere, the URL matching starts directly with the hostname so there's
  788. no need to match the "http://" portion.
  789.  
  790.  
  791. $TYPE(code)
  792.  
  793. Content Type check command. This command can be used to limit a filter to
  794. only affect certain types of pages (like JavaScript files only). The "code"
  795. must be one of the following known types...
  796.  
  797. htm  - Web pages
  798. css  - Cascading style sheets
  799. js   - JavaScript
  800. vbs  - VB Script
  801. oth  - Anything else
  802.  
  803. This is a fast and simple check. For more complex content-type checks you
  804. can also use "$OHDR(Content-Type:some matching value)"
  805.  
  806.  
  807. $RDIR(http://some.url.com/)
  808.  
  809. The RDIR (redirect) command is used to transparently redirect URLs to a different
  810. location. It's also possible to redirect to a local file by using the
  811. "http://file//filename" URL command syntax.   The new URL must be of a type
  812. Proxomitron understands (http, or with SSLeay, https).
  813.  
  814.  
  815. $JUMP(http://some.url.com/)
  816.  
  817. Similar to the RDIR command, the JUMP command can be used to redirect a 
  818. URL to a different location.  However instead of transparent redirection
  819. this works by just telling your browser to go to that new location. It's
  820. more like using a refresh "meta" tag or setting document.location in
  821. a JavaScript.
  822.  
  823. With JUMP your browser is aware of the redirection and the URL you see
  824. will be updated to reflect the new location.  It works best for redirecting
  825. an entire page, while RDIR is better at invisibly redirecting individual
  826. page elements like images or java apps.  Use RDIR when you want the
  827. redirection to happen "behind the scenes" and use JUMP when you want to
  828. simply go to a different site from the one requested.
  829.  
  830. Use both RDIR and JUMP commands in the replacement section of *header*
  831. filters only. It's important to note that for outgoing headers the redirect
  832. will happen before the original site is ever contacted, but when used with
  833. incoming headers, the initial site must be contacted first.  These commands
  834. have no effect in web filters since by this point the original page
  835. has already begun loading into your browser. In such cases you can
  836. often use JavaScript to change to a new location as in...
  837.  
  838. <script> document.location="http://some.new.url/"; </script>
  839.  
  840.  
  841. $FILTER(bool)
  842.  
  843. The $FILTER command can be used to force a particular request to be filtered
  844. or not filtered regardless of it's type.  Normally only specific types are
  845. filtered (like text/html, text/css, image/gif, etc).  $FILTER can be used in
  846. the match or replace of any header filter and takes a "true" or "false" 
  847. value.  If true, the request will be run through the web filters regardless
  848. of it's type.  This only makes sense for content that's text based. 
  849.  
  850. You can also use it to avoid "freezing" certain GIF images by using it in
  851. a header filter along with a URL match.
  852.  
  853. Take for example...
  854.  
  855. Out = "True"
  856. Key="URL: Don't freeze this gif"
  857. URL="www.somewhere.com/animate_me.gif"
  858. Replace="$FILTER(False)"
  859.  
  860.  
  861. $USEPROXY(bool)
  862.  
  863. The $USEPROXY command can override the "Use remote proxy" check box for a 
  864. given connection either turning the proxy on or off. It can be use to ensure
  865. a proxy is or isn't used for with a given site or for a particular action.
  866.  
  867. To have effect this command must be called in either the match or replace
  868. of an *outgoing* header filter. This is because the proxy setting must be
  869. established prior to connecting to the site.
  870.  
  871.  
  872. $SETPROXY(proxy:port)
  873.  
  874. The $SETPROXY command will force a connection to use a particular proxy. It
  875. overrides both the "Use remote proxy" checkbox and the current proxy chosen
  876. in the proxy selector. It's useful for insuring a particular proxy is used
  877. in a given situation or with a particular URL.
  878.  
  879. The proxy to set *must* be one entered into the External Proxy Selector list.
  880. This command simply looks up and sets a proxy from that list.  It's usually 
  881. only necessary type the first part of the proxy name - the first proxy 
  882. matched in the list will be use. The partial match must be exact
  883. though (no wildcards).
  884.  
  885. Like the previous command  this command must be also called in either
  886. the match or replace of an *outgoing* header filter.
  887.  
  888.  
  889. $UESC(escaped text)
  890.  
  891. The $UESC command is intended to be similar to the JavaScript unescape()
  892. command. It will convert most URL escaped characters back to their ASCII
  893. form. It's useful for unescaping URLs that may be embedded in other URLs
  894. (an increasingly common trick used by many sites to track the links you
  895. click). Often characters like ":" and "/" will be escaped by their hex
  896. equivilents ("%3A" and "%2F") making the real URL hard to use.
  897.  
  898. $UESC can be used in the replacement text of a filter, and can be given 
  899. any valid replacement text as input (such as \1 variables). It will
  900. convert most escaped characters back to their correct form, but spaces 
  901. and any non-displayable ASCII characters will remain escaped.
  902.  
  903. +++++++++++++++++++
  904.  
  905. Well that's about it for now.  Many of the new features in "settings" I hope
  906. are more or less self-explanatory, but feel free to email me if you've got
  907. any questions.  Also check the various context menus as blocklist features
  908. have been added to many of 'em.  Keep in mind all this stuff could easily
  909. change a before an actual release - especially the syntax of new commands.
  910. I'm not exactly sure what will work best yet in all areas.
  911.  
  912. -Scott-