Use Fast Redirect to easily redirect your domains.

Overview

Fast Redirect

Use Fast Redirect to easily redirect your domains.

Fast Redirects expects a JSON 'database'. This JSON 'database' contains the domains to be redirected. Fast Redirect then redirects traffic as configured.

Fast Redirect uses Starlette, a high-performance ASGI framework. Your redirects are lightning fast. Requirements for all environments can be found in the requirements directory.

How to use

Install

We recommend running Fast Redirect in a venv. The package has been published to PyPI, so you could install it with pip3 install fast-redirect.

Run

All configuration variables can be found in the .env.example file. Only one configuration variable is required to be set: DATABASE_PATH. We recommend setting it to /var/lib/fast-redirect.json. Configuration variables can be set in an .env file or be passed as environment variables.

Run bin/fast-redirect to start the server. By default, it listens on port 8080 and binds to ::1 (IPv6). The server can be daemonized. An example systemd configuration can be found in fast-redirect.service.

JSON Database

The JSON database contains a redirects object. In turn, this object contains an object for each redirect with the following properties:

  • destination_url. The URL to redirect to. Query parameters and the path may be appended (see other options). This must be a URL (i.e. www.domlimev.nl is invalid).
  • status_code. Allowed values 301, 302 and 303.
  • keep_query_parameters. Whether query parameters are kept. If this is false, query parameters are discarded from the destination_url. For example, if this is false, https://domlimev.nl/page?k=v would be redirected to https://example.com.
  • keep_path. Whether the path is kept. If this is false, the path is discarded from the destination_url. For example, if this is false, https://domlimev.nl/this/is/a/path would be redirected to https://example.com.

In case a redirect is misconfigured, the error is returned to the visitor.

Example JSON database:

{
  "redirects": {
    "domlimev.nl": {
      "destination_url": "https://example.com",
      "status_code": 301,
      "keep_query_parameters": true,
      "keep_path": true
    }
  }
}

Contribute

Feel free to contribute by adding support for real database engines.

Tests

pytest is used for tests. You run it as you'd expect, i.e.:

pytest tests/

Security

You can reach us at [email protected] to report security issues.

Owner
Cyberfusion
Improve uptime and performance with managed hosting for digital agencies. Hosting for agencies and load balancing solutions.
Cyberfusion
A simple tool to get information about IP

IP Info Tool Just a simple tool to get IP's information, it uses requests module to gather information about IP, if you dont have much knowledge about

0 Dec 01, 2021
A Python framework for interacting with Solana's Pyth network.

Pyth Network A basic Python framework for reading and decoding data regarding the Pyth network

1 Nov 29, 2021
MoreIP 一款基于Python的面向 MacOS/Linux 用户用于查询IP/域名信息的日常渗透小工具

MoreIP 一款基于Python的面向 MacOS/Linux 用户用于查询IP/域名信息的日常渗透小工具

xq17 9 Sep 21, 2022
GhostVPN - Simple and lightweight TUI application for CyberGhostVPN

GhostVPN Simple and lightweight TUI application for CyberGhostVPN. Screenshot Us

Mehmet Ali KERİMOĞLU 5 Jul 27, 2022
A simple software which can use to make a server in local network

home-nas it is simple software which can use to make a server in local network, it has a web site on it which can use by multipale system, i use nginx

R ansh joseph 1 Nov 10, 2021
IoT owl is light face detection and recognition system made for small IoT devices like raspberry pi.

IoT Owl IoT owl is light face detection and recognition system made for small IoT devices like raspberry pi. Versions Heavy with mask detection withou

Ret2Me 6 Jun 06, 2022
A library of functions that can be used to manage the download of claims from the LBRY network.

lbrytools A library of functions that can be used to manage the download of claims from the LBRY network. It includes methods to download claims by UR

13 Dec 03, 2022
Lets you remove all friends, leave GCs, and leave servers, in an instant!

anonymity Lets you remove all friends, leave GCs, and leave servers, in an instant! You can also do each of them by themselves. First, you need to get

1 Dec 07, 2021
Python module to interface with Tuya WiFi smart devices

TinyTuya Python module to interface with Tuya WiFi smart devices Description This python module controls and monitors Tuya compatible WiFi Smart Devic

Jason Cox 365 Dec 26, 2022
a safe proxy over tls

TlsProxys 基于TLS协议的http流量代理 安装 ※ 需要python3.7+ linux: python3.9 -m pip install TlsProxys windows: pip install TlsProxys 基本用法 服务器端: $ tpserver [command]

56 Nov 30, 2022
Library containing the core modules for the kingdom-python-server.

🏰 Kingdom Core Library containing the core modules for the kingdom-python-server. Installation Use the package manager pip to install kingdom-core. p

T10 4 Dec 27, 2021
Multipurpose Growtopia Server tools, can be used for newbie to learn things.

Multipurpose Growtopia Server tools, can be used for newbie to learn things.

FelixF 3 Dec 01, 2021
Utility for converting IP Fabric webhooks into a Teams format.

IP Fabric Webhook Integration for Microsoft Teams Setup IP Fabric Setup Go to Settings Webhooks Add webhook Provide a name URL will be: 'http://Y

Community Fabric 1 Jan 26, 2022
A simple python script to send cute messages to my boyfriend.

Morning Messages A simple python script to send cute messages to my boyfriend. It gives him the weather and news currently. Installation git clone htt

Sabrina Medwinter 3 Oct 12, 2022
BibleNotifyDesktop - Desktop version of Bible Notify

Bible Notify Desktop This is the repository for the Desktop version of the daily

Bible Notify 5 Nov 16, 2022
Caching for HTTPX

Caching for HTTPX. Note: Early development / alpha, use at your own risk. This package adds caching functionality to HTTPX Adapted from Eric Larson's

Mehul Solanki 0 Oct 08, 2022
TunnelProxy 是一个本地隧道代理,可以从fofa爬取免费的socks代理,然后构建代理池,如果一个代理失效,会自动切换

TunnelProxy 是一个本地隧道代理,可以从fofa爬取免费的socks代理,然后构建代理池,如果一个代理失效,会自动切换。 应用场景 渗透测试需要访问某些国内网站(比如edu的),想要隐藏自己,但是国外代理不能访问,也没有稳定的可用代理的时候。 之后,可能我会增加国外代理,实现白嫖科学上网。

urdr-gungnir 45 Nov 17, 2022
Tool written on Python that locate all up host on your subnet

HOSTSCAN Easy to use command line network host scanner. From noob to noobs. Dependencies Nmap 7.92 or superior Python 3.9 or superior All requirements

NexCreep 4 Feb 27, 2022
Tripwire monitors ports and icmp to send the admin a message if somebody is scanning a machine that shouldn't be touched

Tripwire monitors ports and icmp to send the admin a message if somebody is scanning a machine that shouldn't be touched

3 Apr 05, 2022
pyWhisker is a Python equivalent of the original Whisker made by Elad Shamir and written in C#.

PyWhisker pyWhisker is a Python equivalent of the original Whisker made by Elad Shamir and written in C#. This tool allows users to manipulate the msD

Shutdown 325 Jan 08, 2023