Skip to main content

A tool to request a specified `url` and return the response.

Project description

URL Probe

Test Status Code Coverage

This tool helps test complex cloud network setups, like those with private services that have specific exit points. It's especially useful for checking if your cloud services can talk to each other within a virtual private cloud and those services can make requests to the outside world as expected.

Use Case Say you have a Cloud Load Balancer, two Cloud Run services (Service A and Service B) and a Cloud Subnetwork with a static egress IP. You have deployed this infrastructure and want to verify that the Cloud Load Balancer can access Service A, that Service A can access Service B and that requests from Service B appear from the subnetwork static egress IP.

    Internet
        |
        |
    +-------+
    |       |
    | Cloud |
    |  Run  |  (A) - Publicly Accessible
    +-------+
        | (Target URL Parameter)
        |
        v (Internal Network Traffic)
    +-------+
    |       |
    | Cloud |
    |  Run  |  (B) - Internal Service
    +-------+
        | (Outbound Request via Static IP)
        |
        v
    +---------------+
    | External      |
    | Target Server |
    +---------------+

The network connectivity and the public IP can be verified by deploying the urlprobe tool to Service A and Service B and sending a chained curl request to the exposed service and requesting the public IP from https://api.ipify.org as the last step in the chain. For example, if the network is configured as per this use case, a curl request:

curl -s http://external-cloud-run-service-a-ip/?url=http://internal-cloud-run-service-b-ip/?url=https://api.ipify.org?format=json

will be received at Service A, then at Service B and finally at https://api.ipify.org will return the public IP.

Installation

The urlprobe tool is available on PiPy and can be installed via pip:

  1. Install Python 3.10+: Ensure you have Python 3.10 or a later version installed.
  2. Install the package from PyPI using pip:
pip install urlprobe
  1. (optional) Install the package from TestPyPI using pip:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ urlprobe

How you deploy the urlprobe tool depends on the type of infrastructure under test e.g. packaged as a Docker image or deployed as a cloud function.

Usage

Running as a standalone application

  1. Run the server:
python -m urlprobe

(optionally) run the server with non-default args

python -m urlprobe --host 0.0.0.0 --port 8081 --debug
  1. Send a GET request to the server with the url parameter:
curl -s "http://<edge-service-ip>:8080/?url=https://<internal-service-ip>"

Replace <edge-service-ip> with the IP address or hostname of your externally accessible edge service. For example, when running as a standalone application on localhost:

curl -s "http://localhost:8080/?url=https://api.ipify.org?format=json"

Output

The server will return a JSON object containing detailed information the request chain, including:

  • Edge Service Response: Status code, headers, and body from the target service."
  • Error Messages: Detailed error messages for any failures encountered during the request chain.

Contributing

Please see Contributing Guidelines for details on:

  • Setting up your development environment
  • Code style and standards
  • Pull request process
  • Running tests

Versioning

This project follows Semantic Versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urlprobe-1.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urlprobe-1.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file urlprobe-1.1.0.tar.gz.

File metadata

  • Download URL: urlprobe-1.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for urlprobe-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a73e4cb82d78328f1c0c34d5c49f75d68ec053e5e6a37389a010adbbb4c39d98
MD5 8299224d9a5e4b32dc9f6657db691bdb
BLAKE2b-256 ae371bd56868207b2d5cead8e5794339b6e81675b1a51638e51e93323f8bc61b

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlprobe-1.1.0.tar.gz:

Publisher: release.yml on av603/urlprobe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file urlprobe-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: urlprobe-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for urlprobe-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4259b01bcc7fec167cc22012fea0633815224dee983f8297ba9cb4ccd4abbbec
MD5 9f433f90c5d4eabeb3e671903e06ce69
BLAKE2b-256 bed24e625e8e60f46032f129d328dfd90a9f0cba989eb4be665f6121bf0e9018

See more details on using hashes here.

Provenance

The following attestation bundles were made for urlprobe-1.1.0-py3-none-any.whl:

Publisher: release.yml on av603/urlprobe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page