Go forward proxy with bandwidth limiting.

Goforward

Latest Tag Go Report Card GitHub Workflow Status GitHub Releases

Go forward proxy with rate limiting. The code is based on Michał Łowicki's 100 LOC forward proxy.

Screenshot

Download

Releases can be downloaded from here.

Install

go get -v github.com/jamesmoriarty/goforward
go install github.com/jamesmoriarty/goforward

Usage

goforward
goforward -h
Usage of goforward:
  -port string
        Proxy listen port (default "8888")g
  -rate int
        Proxy bandwidth ratelimit (default 524288)

use with .exe on windows.

Build

go build .\cmd\goforward.go

Test

go test

Why

I needed a way to download 53GB without making my household internet unusable. In summary:

  1. Free games.
  2. Australia's terrible internet.
  3. Learning Go.

First Solution

Shape the traffic in the application.

Application Bandwidth Shaping

Second Solution

Shape the traffic in kernal space.

Windows Filtering Platform

Third Solution

Shape the traffic in user space.

Forward Proxy

Owner
James Moriarty
Apparently, this user prefers to keep an air of mystery about them.
James Moriarty
Similar Resources

Simple-request-limiter - Example of limiting API requests using standard Go library

Route: http://localhost:8080/urls example of body in POST request that was used:

Feb 2, 2022

Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups

Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups

goodbots - trust but verify goodbots verifies the IP addresses of respectful crawlers like Googlebot by performing reverse dns and forward dns lookups

Aug 16, 2022

A http-relay server/client written in golang to forward requests to a service behind a nat router from web

http-relay This repo is WIP http-relay is a server/client application written in go(lang) to forward http(s) requests to an application behind a nat r

Dec 16, 2021

SmartGateway is smart gateway.It uses iptables to forward traffic.

SmartGateway SmartGateway is smart gateway.It uses iptables to forward traffic. The traffic outbounds is tproxy of v2ray. SmartGateway run in docker,

Dec 30, 2021

Listmonk-messenger - Lightweight HTTP server to handle webhooks from listmonk and forward it to different messengers

Listmonk-messenger - Lightweight HTTP server to handle webhooks from listmonk and forward it to different messengers

listmonk-messenger Lightweight HTTP server to handle webhooks from listmonk and

Dec 28, 2022

Udp forward - Forwarding UPD requests with golang

udp_forward About tool I want to check how GOlang work with network... It tool t

Feb 3, 2022

A simple port forward tools build on libp2p with holepunch support.

p2p-tun A simple port forward and tun2socks tools build on libp2p with holepunch support. Usage NAME: p2p-tun - port forward and tun2socks through

Dec 20, 2022

Use qs-forward with QuickSocket to enable easy local development and testing!

Use qs-forward with QuickSocket to enable easy local development and testing!

qs-forward Use qs-forward with QuickSocket to enable easy local development and testing! Getting Started Want to jump in quick? Head over to the relea

Jul 3, 2022
Comments
  • Don't mutate default transport

    Don't mutate default transport

    	dialer := &net.Dialer{}
    
    	http.DefaultTransport.(*http.Transport).DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
    		conn, err := dialer.DialContext(ctx, network, addr)
    
    		return RateLimitedConn{conn, bucket}, err
    	}
    
    	http.DefaultTransport.(*http.Transport).DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
    		dialer := &net.Dialer{}
    		conn, err := dialer.DialContext(ctx, network, addr)
    
    		return RateLimitedConn{conn, bucket}, err
    	}
    

    Need to create custom transport https://forum.golangbridge.org/t/net-http-dialcontext/8200/5

    tr := &http.Transport{DialContext: portInfo.myDialContext,
    
Go package to simulate bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces

lossy Go package to simulate bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces. Its main usage is to test robustness of ap

Oct 14, 2022
Automatically compress podcasts to tiny file sizes for bandwidth constrained devices like cellular.
Automatically compress podcasts to tiny file sizes for bandwidth constrained devices like cellular.

tinycast Automatically compress podcasts to tiny file sizes for bandwidth constrained connections like cellular or satellite.

Sep 18, 2022
Light weight http rate limiting proxy

Introduction Light weight http rate limiting proxy. The proxy will perform rate limiting based on the rules defined in the configuration file. If no r

Dec 23, 2022
Goproxy - HTTP/HTTPS Forward and Reverse Proxy

Go HTTP(s) Forward/Reverse Proxy This is intended to provide the proxy for the goproxy frontend. It is currently a work in progress, and is not very s

Jan 4, 2022
Golang implementation of Sliding Window Algorithm for distributed rate limiting.
Golang implementation of Sliding Window Algorithm for distributed rate limiting.

slidingwindow Golang implementation of Sliding Window Algorithm for distributed rate limiting. Installation $ go get -u github.com/RussellLuo/slidingw

Dec 27, 2022
HTTP rate limiting module for Caddy 2

This module implements both internal and distributed HTTP rate limiting. Requests can be rejected after a specified rate limit is hit.

Jan 3, 2023
A very simple rate limiter in go, made as a learning project to learn go and rate limiting patterns!
A very simple rate limiter in go, made as a learning project to learn go and rate limiting patterns!

rate-limiter-go A very simple rate limiter in go, made as a learning project to learn go and rate limiting patterns! Demo: Running the project: To exe

Jun 1, 2022
A little ping pong service that implements rate limiting with golang

Fred the Guardian Introduction Writing a little ping pong service that implements rate limiting with the programming language golang. Requirements Web

Jan 2, 2022
A Caddy v2 extension to apply rate-limiting for HTTP requests

ratelimit A Caddy v2 extension to apply rate-limiting for HTTP requests. Installation $ xcaddy build --with github.com/owlwang/caddy-ratelimit Caddyfi

Jan 28, 2022