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-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

urlprobe-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for urlprobe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eaa0396c3d5145fa2ab71be2a3ef8bdfd3660db4f1b272e123a1538f371bffeb
MD5 b025fcd71f25e86a1e0142dea98a54e3
BLAKE2b-256 00ee42c84e3c2708db26d188fd76a8c71be97ea0e059c55846861967c44de51b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for urlprobe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8470245daa22eb395ca52d4d6f339f4fd802210a47fd4bbf426aeb23252bf7c9
MD5 45445b11cb7a2e1a4ae4e90db089800f
BLAKE2b-256 52096da3da4666860b63ac5c877b542de5420220d8c4197a41a12bc523613052

See more details on using hashes here.

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