| 1 | package App::proxyforurl; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | our $VERSION = '1.02'; | ||
| 6 | |||
| 7 | 1; | ||
| 8 | |||
| 9 | =encoding utf8 | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | App::proxyforurl - An online proxy PAC file parser | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | L<App::proxyforurl> is a web application that can be used to test proxy PAC | ||
| 18 | files. | ||
| 19 | |||
| 20 | The L<server side|Mojolicious> is used to serve the web page, but does also | ||
| 21 | provide functionality for resolving hostnames and checking if an IP is within | ||
| 22 | a given net. | ||
| 23 | |||
| 24 | =head2 Demo | ||
| 25 | |||
| 26 | Check out L<https://thorsen.pm/proxyforurl> for a running example. | ||
| 27 | |||
| 28 | =head2 Missing features | ||
| 29 | |||
| 30 | The client side PAC parser does not fully support C<dateRange()>, C<timeRange()> | ||
| 31 | or C<weekdayRange()>. These functions simply return true, no matter what the | ||
| 32 | input is. | ||
| 33 | |||
| 34 | =head1 SYNOPSIS | ||
| 35 | |||
| 36 | $ proxyforurl --listen http://*:8080; | ||
| 37 | |||
| 38 | With optional environment variables: | ||
| 39 | |||
| 40 | $ PROXYFORURL_TEMPLATES=/path/to/templates \ | ||
| 41 | PROXYFORURL_BRAND_NAME=Thorsen \ | ||
| 42 | PROXYFORURL_BRAND_URL=https://thorsen.pm \ | ||
| 43 | PROXYFORURL_X_REQUEST_BASE="https://thorsen.pm/proxyforurl" \ | ||
| 44 | proxyforurl --listen http://*:8080; | ||
| 45 | |||
| 46 | =over 2 | ||
| 47 | |||
| 48 | =item * PROXYFORURL_TEMPLATES | ||
| 49 | |||
| 50 | Can be set to a custom directory to override templates. | ||
| 51 | |||
| 52 | =item * PROXYFORURL_BRAND_NAME, PROXYFORURL_BRAND_URL | ||
| 53 | |||
| 54 | Used to change the menu item text and URL. | ||
| 55 | |||
| 56 | =item * PROXYFORURL_X_REQUEST_BASE | ||
| 57 | |||
| 58 | Can be set to a custom request base, in case the app is not mounted at "/". | ||
| 59 | |||
| 60 | =back | ||
| 61 | |||
| 62 | =head1 SEE ALSO | ||
| 63 | |||
| 64 | =over 4 | ||
| 65 | |||
| 66 | =item * L<https://findproxyforurl.com/> | ||
| 67 | |||
| 68 | =item * L<https://github.com/pacparser/pacparser> | ||
| 69 | |||
| 70 | =back | ||
| 71 | |||
| 72 | =head1 DISCLAIMER | ||
| 73 | |||
| 74 | The parsing is done using good old C<eval()> on the client side, which means | ||
| 75 | that the pasted PAC file could in theory contain code which could steal | ||
| 76 | cookies, inject alien JavaScript or do other harmful things. | ||
| 77 | |||
| 78 | There is a safety net installed to prevent this from happening, but since | ||
| 79 | this is software, there might be bugs. | ||
| 80 | |||
| 81 | =head1 COPYRIGHT AND LICENSE | ||
| 82 | |||
| 83 | Copyright (C) Jan Henning Thorsen | ||
| 84 | |||
| 85 | This program is free software, you can redistribute it and/or modify it under | ||
| 86 | the terms of the Artistic License version 2.0. | ||
| 87 | |||
| 88 | =head1 AUTHOR | ||
| 89 | |||
| 90 | Jan Henning Thorsen - C<jhthorsen@cpan.org> | ||
| 91 | |||
| 92 | =cut |