thetredev / ipv64-api

IPv64.net API Proxy Implementation (PoC)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPv64.net API Proxy Implementation (PoC)

This project aims to be a proof of concept proxy implementation of the IPv64.net API. The implementation is written in Python 3.11 with the help of FastAPI.

Note: Only the API part is implemented/proxied, not the Updater part.

The code

Have a look at the poc/api.py file.

Why "proxy implementation"?

The IPv64.net API is neither OpenAPI compliant, nor is it documented in a developer-friendly way. This PoC is just a concept of how you could communicate with it and how the API calls actually work on a technical level.

Setting up a local development environment

All you need is an editor with Python installed (minimum: 3.9, preferred: 3.11) and the following PIP packages:

To run the dev server, execute the following command (works on both Linux and Windows):

uvicorn poc.api:api --reload

For Linux I created a helper script dev-server.sh which does the same thing.

Or: Use a VS Code dev container (Linux only)

Open the project in VS Code, install the extension Dev Containers, and execute Dev Containers: Reopen in Container from the command pallet.

Note: If your UID/GID pair is NOT 1000:1000, make sure to update the Dockerfile accordingly:

Change

# Add user 'vscode'
RUN groupadd -rg 1000 vscode && \
    useradd -rms /bin/bash -d /home/vscode -u 1000 -g vscode vscode

to

# Add user 'vscode'
RUN groupadd -rg <YOUR GID> vscode && \
    useradd -rms /bin/bash -d /home/vscode -u <YOUR UID> -g vscode vscode

OpenAPI UI

Head over to http://localhost:8000/docs after you've run the server to test it.

About

IPv64.net API Proxy Implementation (PoC)

License:MIT License


Languages

Language:Python 83.2%Language:Dockerfile 15.4%Language:Shell 1.4%