### Proxydetoxrc File Configuration Example Source: https://github.com/kiron1/proxydetox/blob/main/doc/configuration.md This example demonstrates the equivalent configuration for proxydetoxrc, where each command-line option is on a new line. ```sh --negotiate --listen 127.0.0.1:8080 --pac-file http://example.org/proxy.pac ``` -------------------------------- ### Enable and Start Proxydetox Service on Linux Source: https://github.com/kiron1/proxydetox/blob/main/doc/service.md Commands to reload systemd, enable the proxydetox user service, and start it. ```sh systemctl --user daemon-reload systemctl --user enable proxydetox.service systemctl --user start proxydetox.service ``` -------------------------------- ### Install Proxydetox using Cargo from Local Path Source: https://github.com/kiron1/proxydetox/blob/main/doc/build.md Installs the proxydetox binary from a locally cloned repository. ```sh cargo install --path . ``` -------------------------------- ### Install Rust Target and Toolchain Source: https://github.com/kiron1/proxydetox/blob/main/doc/cross_compile.md Installs the necessary Rust target for Windows and a stable toolchain for it. ```sh rustup target add x86_64-pc-windows-gnu rustup toolchain install stable-x86_64-pc-windows-gnu ``` -------------------------------- ### Install Proxydetox using Cargo from Git Source: https://github.com/kiron1/proxydetox/blob/main/doc/build.md Installs the proxydetox binary to ~/.cargo/bin by cloning the repository directly from GitHub. ```sh cargo install --git https://github.com/kiron1/proxydetox.git ``` -------------------------------- ### Proxydetox CLI Configuration Example Source: https://github.com/kiron1/proxydetox/blob/main/doc/configuration.md This example shows how to configure Proxydetox using command-line arguments, which can be mirrored in the proxydetoxrc file. ```sh proxydetox --negotiate --listen 127.0.0.1:8080 --pac-file http://example.org/proxy.pac ``` -------------------------------- ### Install Proxydetox Service on macOS Source: https://github.com/kiron1/proxydetox/blob/main/doc/service.md Shell script to install and enable the Proxydetox service using launchctl. ```sh {{#include launchctl.sh:install}} ``` -------------------------------- ### Install Proxydetox on Windows Source: https://github.com/kiron1/proxydetox/blob/main/doc/installation.md Installs Proxydetox on Windows by unzipping the provided zip file and running the install.bat script. ```bat @echo off set "PROXIDETOX_DIR=%~dp0" REM Install Proxydetox copy /Y "%PROXIDETOX_DIR%proxydetox.exe" "C:\Program Files\Proxydetox\" copy /Y "%PROXIDETOX_DIR%proxydetox.exe.config" "C:\Program Files\Proxydetox\" REM Create shortcut in Start Menu if not exist "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Proxydetox" mkdir "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Proxydetox" echo "" > "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Proxydetox\Proxydetox.lnk" (echo Proxydetox&echo "C:\Program Files\Proxydetox\proxydetox.exe") > "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Proxydetox\Proxydetox.lnk" echo Proxydetox installed successfully. pause ``` -------------------------------- ### Install Proxydetox on macOS Source: https://github.com/kiron1/proxydetox/blob/main/doc/installation.md Installs the Proxydetox package on macOS using the installer command. This command requires root privileges. ```sh sudo installer -package proxydetox-*-x86_64-apple-darwin.pkg -target / ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/kiron1/proxydetox/blob/main/doc/build.md Ensures that the necessary Xcode command line tools are installed, which is a prerequisite for building with Bazel on macOS. ```sh xcode-select --install ``` -------------------------------- ### Install Proxydetox with Negotiate Feature using Cargo Source: https://github.com/kiron1/proxydetox/blob/main/doc/build.md Installs the proxydetox binary with the 'negotiate' feature enabled, which is required for Negotiate authentication. ```sh cargo install --git https://github.com/kiron1/proxydetox.git --features negotiate ``` -------------------------------- ### Netrc File for Basic Authentication Source: https://github.com/kiron1/proxydetox/blob/main/doc/configuration.md This example shows the format of the .netrc file for storing basic authentication credentials. Note that this method is insecure as it stores passwords in plain text. ```sh machine proxy.example.org login ProxyUsername password ProxyPassword ``` -------------------------------- ### Install MinGW-w64 C Cross-Compiler via pkgsrc Source: https://github.com/kiron1/proxydetox/blob/main/doc/cross_compile.md Installs the MinGW-w64 cross-compiler and winpthreads library using the pkgsrc package manager. ```sh sudo pkgin install mingw-w64-x86_64-gcc mingw-w64-x86_64-winpthreads-8.0.0 ``` -------------------------------- ### Install Proxydetox on Debian-based Linux Source: https://github.com/kiron1/proxydetox/blob/main/doc/installation.md Installs the Proxydetox Debian package using dpkg. Ensure you have downloaded the correct .deb file. ```sh sudo dpkg --install proxydetox-*-x86_64-linux.deb ``` -------------------------------- ### Configure Proxydetox LaunchAgent on macOS Source: https://github.com/kiron1/proxydetox/blob/main/doc/installation.md Commands to install and uninstall the Proxydetox LaunchAgent. These commands should be run as the user who will use Proxydetox, not as root. ```sh #!/bin/sh # Install Proxydetox LaunchAgent cp "./assets/cc.colorto.proxydetox.plist" "$HOME/Library/LaunchAgents/" launchctl load "$HOME/Library/LaunchAgents/cc.colorto.proxydetox.plist" ``` ```sh #!/bin/sh # Uninstall Proxydetox LaunchAgent launchctl unload "$HOME/Library/LaunchAgents/cc.colorto.proxydetox.plist" rm "$HOME/Library/LaunchAgents/cc.colorto.proxydetox.plist" ``` -------------------------------- ### Proxydetox PAC File via Local Path Source: https://github.com/kiron1/proxydetox/blob/main/doc/configuration.md This example shows how to specify the PAC file location using a local file path. ```sh proxydetox --pac-file /tmp/test.pac ``` -------------------------------- ### Proxydetox PAC File via HTTP URL Source: https://github.com/kiron1/proxydetox/blob/main/doc/configuration.md This example shows how to specify the PAC file location using an HTTP URL. Proxydetox will download the PAC file from this address. ```sh proxydetox --pac-file http://example.org/proxy.pac ``` -------------------------------- ### Manage Proxydetox systemd User Daemon Source: https://github.com/kiron1/proxydetox/blob/main/doc/installation.md Commands to enable, start, stop, and disable the Proxydetox systemd user daemon. These commands are run using the --user flag. ```sh systemctl --user daemon-reload systemctl --user enable proxydetox systemctl --user start proxydetox ``` ```sh systemctl --user stop proxydetox systemctl --user disable proxydetox ``` -------------------------------- ### Retrieve All Proxydetox Configuration Options Source: https://github.com/kiron1/proxydetox/blob/main/doc/configuration.md This command displays the full list of available configuration options for Proxydetox, typically used to understand all possible settings. ```sh proxydetox --help ``` -------------------------------- ### Proxydetox CLI Help Output Source: https://github.com/kiron1/proxydetox/blob/main/doc/cliref.md Displays the full help message for the proxydetox command, outlining all available subcommands and global options. Use this to understand the CLI's capabilities. ```bash Usage: proxydetox [OPTIONS] Proxydetox is a tool for managing and analyzing proxy configurations. Options: -c, --config Path to the configuration file [env: PROXYDETOX_CONFIG] -h, --help Print help information -V, --version Print version information Commands: help Prints this public message run Run proxydetox on a given file list List all available proxy configurations add Add a new proxy configuration remove Remove a proxy configuration by ID update Update an existing proxy configuration by ID export Export a proxy configuration by ID import Import a proxy configuration from a file validate Validate a proxy configuration file clean Clean up old proxy configurations status Show the current status of proxydetox logs Show proxydetox logs config Manage proxydetox configuration settings Run "proxydetox help " for more information on a specific command. ``` -------------------------------- ### Build ProxydetoxApp (macOS UI) using Bazel Source: https://github.com/kiron1/proxydetox/blob/main/doc/build.md Builds the macOS application bundle for Proxydetox using Bazel. ```sh bazel build //macos/app:ProxydetoxApp ``` -------------------------------- ### Build Proxydetox with Negotiate Feature using Bazel Source: https://github.com/kiron1/proxydetox/blob/main/doc/build.md Builds the project using Bazel with the 'negotiate' feature enabled for all targets. ```sh bazel build --features=negotiate //... ``` -------------------------------- ### Create and Configure User Group Source: https://github.com/kiron1/proxydetox/blob/main/doc/transparent_proxy.md Creates a system group named 'proxydetox' and adds the current user to this group. ```sh addgroup --system proxydetox usermod -aG proxydetox $(id -u) ``` -------------------------------- ### Cross Compile Rust Project for Windows Source: https://github.com/kiron1/proxydetox/blob/main/doc/cross_compile.md Sets the RUSTFLAGS environment variable to include the path to the winpthreads library and then builds the project for the specified Windows target. ```sh export RUSTFLAGS="-L /opt/pkg/cross/x86_64-w64-mingw32-winpthreads/mingw/lib" cargo build --target x86_64-pc-windows-gnu ``` -------------------------------- ### JavaScript SSE Client for Access Log Source: https://github.com/kiron1/proxydetox/blob/main/proxydetoxlib/src/accesslog.html Connects to the /access.log SSE endpoint to receive and display log messages. Includes event listeners for open, message, lagged, and error events. Provides a button to close the connection. ```javascript const button = document.getElementById("stop"); const eventList = document.getElementById("events"); const sse = new EventSource(location.origin + "/access.log"); sse.addEventListener("open", (e) => { // Connection opened }); sse.addEventListener("message", (e) => { const newElement = document.createElement("li"); newElement.textContent = e.data; eventList.appendChild(newElement); }); sse.addEventListener("lagged", (e) => { console.log(`lagged ${e.data}`); }); sse.addEventListener("error", (e) => { console.log("EventSource error"); }); button.addEventListener("click", (e) => { console.log("Connection closed"); sse.close(); }); ``` -------------------------------- ### Enable IP Forwarding Source: https://github.com/kiron1/proxydetox/blob/main/doc/transparent_proxy.md Enables IP forwarding on the system, which is necessary for the proxy to function. ```sh sysctl -w net.ipv4.ip_forward=1 ``` -------------------------------- ### Run proxydetox with Group Source: https://github.com/kiron1/proxydetox/blob/main/doc/transparent_proxy.md Executes the 'proxydetox' command within the 'proxydetox' group context. This ensures that traffic generated by proxydetox itself is not subject to the redirection rules, avoiding loops. ```sh sg proxydetox -c proxydetox ``` -------------------------------- ### Cargo Configuration for Windows Target Source: https://github.com/kiron1/proxydetox/blob/main/doc/cross_compile.md Configures Cargo to use the MinGW-w64 GCC linker and specifies the library search path for winpthreads when targeting x86_64-pc-windows-gnu. ```toml [target.x86_64-pc-windows-gnu] linker = "/opt/pkg/cross/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc" rustc-link-search = ["/opt/pkg/cross/x86_64-w64-mingw32-winpthreads/mingw//lib/"] ``` -------------------------------- ### Set Proxydetox Environment Variables Source: https://github.com/kiron1/proxydetox/blob/main/doc/usage.md Configure http_proxy, https_proxy, and no_proxy environment variables to direct traffic through Proxydetox. These settings are typically added to shell profile files for persistence. ```sh http_proxy=http://127.0.0.1:3128 https_proxy=http://127.0.0.1:3128 no_proxy=127.0.0.1,localhost,::1 export http_proxy https_proxy no_proxy ``` -------------------------------- ### List iptables NAT Rules Source: https://github.com/kiron1/proxydetox/blob/main/doc/transparent_proxy.md Displays the current iptables NAT table rules with verbose output and line numbers for easy reference and management. ```sh iptables -t nat -L -v --line-numbers ``` -------------------------------- ### Fetch Latest Release Tag Source: https://github.com/kiron1/proxydetox/blob/main/www/index.html This snippet fetches the latest release tag name from the GitHub API for the Proxydetox repository and updates an HTML element with the version. ```javascript fetch("https://api.github.com/repos/kiron1/proxydetox/releases") .then(r => r.json()) .then(r => r[0]["tag_name"]) .then(t => document.getElementById("version").innerHTML = t); ``` -------------------------------- ### Uninstall Proxydetox Service on macOS Source: https://github.com/kiron1/proxydetox/blob/main/doc/service.md Shell script to uninstall and disable the Proxydetox service using launchctl. ```sh {{#include launchctl.sh:uninstall}} ``` -------------------------------- ### Configure iptables for Traffic Redirection Source: https://github.com/kiron1/proxydetox/blob/main/doc/transparent_proxy.md Adds an iptables rule to redirect outgoing TCP traffic on port 80 to a local port (3125) unless it originates from the 'proxydetox' group. This prevents infinite loops. ```sh iptables -A OUTPUT -t nat -p tcp --dport 80 -m owner ! --gid-owner proxydetox -j DNAT --to 127.0.0.1:3125 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.