The possibilities are endless:
* download a file through threaded downloading, effectively combining multiple connections' speed in one single file download,
* create two proxies, assign to each its own interface, and run two apps simultaneously that use a different interface,
* create a hotspot proxy at home that connects through Ethernet and your 4G card for all your mobile devices,
Here are some instructions to quickly get started with using the proxy:
* Install Node.JS (http://nodejs.org/).
* Launch a terminal.
* Run the command `npm install -g dispatch-proxy` as a power user and press Enter. It will install the `dispatch` command-line utility.
2) STARTING AN HTTP PROXY
* To quickly start an HTTP proxy, run `dispatch start --http`.
* The program will print the proxy address and port (by default localhost:8080) as well as the list of local addresses the program will be dispatching requests to.
* Configure your system to use the combination address:port as an HTTP proxy.
3) LISTING ALL AVAILABLE NETWORK INTERFACES
* To list all available network interfaces, run `dispatch list`
* Each available network interface will be printed with a list of addresses.
* Right now, the dispatch utility only supports IPv4 addresses.
* If an address is marked to be "internal", then you won't be able to use it to connect to the internet.
I encourage you to read the docs https://github.com/Morhaus/dispatch-proxy.
Great job. I am not too technical so pardon my question. Can multiple 3G connections be combined or have a 'random selector'/failover.
So where I live (you can make a guess), mobile connectivity is not the most reliable in the world. So for instance, POSs are not reliable since one network will always fail. With this, could we use multiple SIMs thereby making them more reliable?
BTW, have you seen BRCK http://www.brck.com/specifications/? Seems to have the sort of the same concept although I think yours is combining speed vs. having a fail-over system for internet access.
The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical "bonded" interface. The behavior of the bonded interfaces depends on the mode. Generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed.
And, ahem, correct load balancing over bonded interfaces is not trivial as it may seem (although, usually it's more likely you'll be able to distribute approximately evenly than not)
EDIT: Yep: https://home.regit.org/netfilter-en/links-load-balancing/
It is possible to do per-packet load sharing in Linux as the link above suggests. Both links need to be able to source traffic using the same IP address, i.e. you can't mix comcast and dsl. The way to get around this is to have an upstream router that will source your traffic from the same IP address:
client - routerD --upstream1---routerU -- the internets
The iptables statistic module with random mode seems to work better than nth packet.
Keep in mind PPS load sharing is not the most effective way to utilize links as retransmissions will slow things down. Now if you have two links to the same provider it's probably OK. You can even buy a bonded connection from most providers where they do all of this for you.
You are much better off doing flow based ECMP routing:
ECMP is only useful if you have a large number of clients. So you can do PPS load sharing, knowing full well that it's going to be slower than a single link some percentage of the time or just buy a faster connection.
TL;DR again, just buy a faster connection.
Mmmhmm, that's the true hacker spirit right there...
I can always make more of one of those.
I'd love to see a write up how well this does stuff that is sensitive to latency and changing network conditions, beyond simple web surfing.
For example, let's say I have 3 interfaces.
Interfaces (1) and (2) are low-latency and interface (3) is high latency.
I can start a proxy on localhost:1080 that redirects to interfaces (1), (2) and (3), and configure my download manager to use it.
I can then start another proxy on localhost:1081 that redirects to interfaces (1) and (2), and configure my game client to use it.
I haven't set this up myself, but I think the iptables method for doing this is `nexthop via`. Never found any great documentation, but this seems to describe it: http://lartc.org/howto/lartc.rpdb.multiple-links.html
I think the iptables method balances across interfaces, not IPs. But I want to balance across IP aliases (multiple IPs, same interface). And I'm usually on a Mac. So I may see if dispatch-proxy is a better choice.
$ sudo ifconfig en0 alias 192.168.2.210 255.255.255.0
$ sudo ifconfig en0 alias 192.168.2.211 255.255.255.0
$ sudo ifconfig en0 alias 192.168.2.212 255.255.255.0
$ dispatch start
SOCKS5 server started on localhost:1080
Dispatching to addresses 192.168.2.28@1, 192.168.2.210@1, 192.168.2.211@1, 192.168.2.213@1
I spent weeks trying to get a reliable setup for streaming concerts in HD from all varieties of spotty WiFi and 4G hotspots. The streaming server wouldn't accept packets that seemed to come from totally different IP addresses so there had to be an intermediate proxy server in the cloud that would re-assemble the data from my various connections.
I was able to get it working and it would have been great for normal Internet usage, but I never found a reliable system for streaming. That was about a year and a half ago. I would love to see this technology mature to the point where it worked well for streaming.
This approach certainly won't work for typical media streaming, as it usually uses a single connection. Particularly, because streaming over multiple connections is tricky because as they don't guarantee delivery order, so you'll probably get your packets "scrambled" and will have to reorder them by yourself (implementing your own flow control).
Any idea will the proxy still be available if one of the connections drops? Like if my broadband cuts out (like it does on a daily basis) will the cellular data automatically take over?
From the world's point of view, you'll be connecting from the VPS's IP address, but between you and the VPS, you can do pretty much anything with the packets.
Granted, that's now how dispatch-proxy works.
I imagine this would work well, not just on networks you own, but with cooperative neighbors as well. What if an entire floor of an apartment building used the same proxy? Would that work?
Every platform which runs NodeJS in fact.
Outcome being, if I download one particular file over HTTP will it run N times as fast, or are you just increasing the total speed available for many connections?
but how to use it system wide ? so apps that don't support the use of proxies will be able to benefit from all this ?
edit: I'm using Mac
Many Mac programs will automatically pick it up.