Skip to content

Commit

Permalink
instructions to compile to exe for major platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ziloka committed Aug 27, 2022
1 parent e18f4ce commit 5bbd628
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 12 deletions.
74 changes: 62 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,33 +100,83 @@ The latest development version can be installed directly from GitHub:
$ pip install -U git+https://github.com/bluet/proxybroker2.git
```

Compiling to a dynamically linked executable
### Build bundled one-file executable with pyinstaller

Important Notes:
- Installs the package on your system
#### Requirements

Unix
Unix based systems

Requirements:
- objdump command (usually located in binutils package)
- Upx (decreases executable size, optional)
Install these tools
- upx
- objdump (this tool is usually in the bintools package)

```
pip install pyinstaller \
&& pip install . \
&& mkdir -p build \
&& cd build \
&& pyinstaller --onefile --add-data "../proxybroker/data:data" --workpath ./tmp --distpath . --clean $(which proxybroker) \
&& pyinstaller --onefile --name proxybroker --add-data "../proxybroker/data:data" --workpath ./tmp --distpath . --clean ../py2exe_entrypoint.py \
&& rm -rf tmp
```

The executable is now in dist/proxybroker directory
The executable is now in the build directory

Debug
- pyi-archive_viewer ./dist/proxybroker to view the archived contents in the executable
Windows

```
pip install pyinstaller \
&& pip install . \
&& mkdir -p build \
&& cd build \
&& pyinstaller --onefile --name proxybroker --add-data "../proxybroker/data;data" --workpath ./tmp --distpath . --clean ../py2exe_entrypoint.py \
&& rm -rf tmp
```


### Use pre-built Docker image
``` {.sourceCode .bash}
$ docker run --rm bluet/proxybroker2 --help
usage: proxybroker [--max-conn MAX_CONN] [--max-tries MAX_TRIES]
[--timeout SECONDS] [--judge JUDGES] [--provider PROVIDERS]
[--verify-ssl]
[--log [{NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}]]
[--min-queue MINIMUM_PROXIES_IN_QUEUE]
[--version] [--help]
{find,grab,serve,update-geo} ...
Proxy [Finder | Checker | Server]
Commands:
These are common commands used in various situations
{find,grab,serve,update-geo}
find Find and check proxies
grab Find proxies without a check
serve Run a local proxy server
update-geo Download and use a detailed GeoIP database
Options:
--max-conn MAX_CONN The maximum number of concurrent checks of proxies
--max-tries MAX_TRIES
The maximum number of attempts to check a proxy
--timeout SECONDS, -t SECONDS
Timeout of a request in seconds. The default value is
8 seconds
--judge JUDGES Urls of pages that show HTTP headers and IP address
--provider PROVIDERS Urls of pages where to find proxies
--verify-ssl, -ssl Flag indicating whether to check the SSL certificates
--min-queue MINIMUM_PROXIES_IN_QUEUE The minimum number of proxies in the queue for checking connectivity
--log [{NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}]
Logging level
--version, -v Show program's version number and exit
--help, -h Show this help message and exit
Run 'proxybroker <command> --help' for more information on a command.
Suggestions and bug reports are greatly appreciated:
<https://github.com/bluet/proxybroker2/issues>
Usage
-----
```

### CLI Examples

Expand Down
2 changes: 2 additions & 0 deletions py2exe_entrypoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import proxybroker.cli as proxybroker_cli
proxybroker_cli.cli()

0 comments on commit 5bbd628

Please sign in to comment.