Code Monkey home page Code Monkey logo

goforward's Introduction

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

goforward's People

Contributors

jamesmoriarty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

goforward's Issues

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,

Implement QOS

Under load first byte latency appears to increase.

Does large chunks causing thrashing between globally locked connections.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.