• Stars
    star
    212
  • Rank 185,568 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Throttle is a simple node.js app that makes it easier to test how a website performs on poor network connections. For example, testing a responsive website on a poor 3G connection without actually having to have a poor 3G connection. Simply connect your Mac to ethernet, share the network connection via Airport, run Throttle, and any connected device will then be throttled to the the network speed you specified. Throttle was designed to be used in conjunction with a device lab and products like shim or Adobe Shadow where a shared connection is expected.

Throttle v0.3.0

Throttle is a simple node.js app that allows you to simulate poor network connections (e.g. like a cellular connection) so you can test how your websites will perform. For example, testing a responsive website on a poor 3G connection without actually having to have a poor 3G connection. To use Throttle simply connect your Mac to ethernet, share that network connection via Airport, turn on Throttle, and any device connected to that WiFi access point will then be throttled to the the network speed you specify via a web-frontend. If you don’t have node.js on your computer don’t fret. It’s very easy to install so you can get Throttle up and running quickly.

It’s important to note that Throttle was designed to be used in conjunction with a device lab and products like shim or Adobe Edge Inspect where a shared connection is expected. That has definitely influenced its design and test cases.

Features

Throttle has some very simple features:

  • Web-based app so it can be accessed & updated from any connected device or computer
  • Modify download network speeds for connected devices
  • Modify upload network speeds for connected devices
  • Modify the latency, or delay, in the network connection for connected devices
  • Use presets to quickly switch between network types
  • The machine Throttle is installed on and devices connect through still has a full-speed Internet connection

Screenshot

You can see what you'll be getting if you install Throttle.

Requirements

Throttle requires the following:

  • a Mac running Mac OS X 10.6.x or 10.7.x
  • a Mac with both ethernet and WiFi ports (so probably won't work with a MacBook Air)
  • node.js v0.8+
  • express 3.0+ (if you're running express 2 or below you can try the older version of Throttle)

I highly encourage you to stay away from 32-bit-only Macs as your Throttle platform.

Installing Throttle

Installing Throttle requires modifying several different parts of your Mac.

Make Sure ipfw Can Run Without a Password

Throttle is simply a web-based wrapper for ipfw. Unfortunately, ipfw requires sudo to run and, therefore, will prompt for a password when the command is run. This doesn't work well for a web-based product. To make sure Throttle and ipfw can run without a password do:

  1. At command prompt type: sudo visudo
  2. Enter in your administrator password
  3. Using the arrow key scroll to the bottom, type i, hit a carriage return so you have a new line and then type: [your username] ALL= NOPASSWD: /sbin/ipfw
  4. Hit ESC and then :wq

Install Node

Install node from http://nodejs.org/. They have a handy Mac OS X installer

Download & Configure Throttle

Run the following commands from the command line:

  1. git clone git://github.com/dmolsen/Throttle.git
  2. cd Throttle
  3. npm install express
  4. npm install jade
  5. node app.js

You should now have Throttle running on port 3000. If the node command was unrecognized try /usr/local/bin/node app.js for step #5

Turn on Internet Sharing

Turn on Internet Sharing so your mobile devices can connect to your Mac as a WiFi access point:

  1. Open Settings > Sharing
  2. Select the 'Internet Sharing' option
  3. Select 'Ethernet' from the 'Share your connection from:' dropdown
  4. Mark the checkbox next to Airport
  5. Mark the checkbox next to 'Internet Sharing' & confirm you want to run it

Any device that uses that WiFi access point will now be throttled based on the options you choose when you configure network performance via Throttle's admin.

Connecting to Throttle to Change Bandwidth & Latency

The easiest way to connect to Throttle from multiple desktops (e.g. designers and developers want to log on from personal machines) is by using xip.io. To do so:

  1. Open Settings > Network
  2. Note the IP address that's listed (will be something like 10.0.x.x or 192.168.x.x)
  3. In the address bar of your browser type: http://10.0.x.x.xip.io:3000 where 10.0.x.x is replaced with the IP address from step #2

You should now see the Throttle admin page. As long as any designers or developers connect to the new WiFi access point they should be able to enter in the xip.io address and change the settings.

Using Adobe Edge Inspect with Throttle

To use Adobe Edge Inspect with Throttle simply make sure all of your devices and your desktop machine are connected to the WiFi point from the Mac Throttle is running on. Note that any latency or other options (but especially latency) will affect the speed of Adobe Edge Inspect. I'll need to look into that.

Other Tools

Another ipfw tool for the Mac is WaterRoof. If you want to test network connection speeds you can always check-out the speedtest.net app for iOS and Android as well as, obviously, the speedtest.net website.

Credits

Throttle started as a hack to shim so thanks to that project and the team at Boston Globe for the inspiration. The presets are derived from Apple's Network Link Conditioner tool and Guy Podjarny's presentation, The Mobile Difference in Numbers. Throttle uses Twitter Bootstrap and Glyphicons for design elements.

More Repositories

1

Detector

Detector is a simple, PHP- and JavaScript-based browser- and feature-detection library that can adapt to new devices & browsers on its own without the need to pull from a central database of browser information.
PHP
847
star
2

lazyBlock

Conditionally load content in responsive designs without relying on AJAX. Proof of concept.
JavaScript
87
star
3

MIT-Mobile-Web

The Mobile Web Project was initially developed during the summer of 2009 and is a fork of the original v0.9 release of the MIT Mobile Web project that can still be found on SourceForge. The project was updated in May 2010. It is a product designed to make it easier for higher education institutions to deliver mobile-optimized information and services. It helps deliver task-based content like maps, events, and directory information optimized for device "families." Full documentation can be found at http://mobilewebosp.pbworks.com/ Updates to the project can be found on Twitter at http://twitter.com/mobilewebosp/
PHP
57
star
4

ua-parser-php

ua-parser-php is now distributed via the central ua-parser GitHub repo maintained by Tobie Langel, Lindsey Simon, and myself. See the link below to review the latest code.
PHP
38
star
5

CSS3-Snowflakes

Some simple CSS for creating snowflakes as well as some JavaScript for quickly adding them to your website.
CSS
32
star
6

Google-Maps-v3-for-jQTouch

A simple example showing how someone can get r133 of jQTouch working with Google Maps v3.
19
star
7

css-rule-saver

Compares a list of CSS rules against an HTML file to see which rules apply and should be saved.
CSS
13
star
8

Mobile-Web-iPhone-Wrapper

A very simple iPhone app that uses UIWebView to render a mobile version of a website. NOT production ready and meant simply as an example.
Objective-C
12
star
9

Foursquare-Statistics

This tool should help higher ed institutions gauge interest/usage of foursquare on their campus. Simply provide a text file with a list of venues and the script will tell you total check-ins, top five venues, check-ins per venue, & total mayors.
PHP
6
star
10

popular-queries-for-gsa

Produces a list of popular queries used to search your Google Search Appliance (GSA) that can be included on your search home page.
PHP
4
star
11

dmolsen.com

My website
JavaScript
3
star
12

MQSugr

MQSugr is a wrapper for Modernizr.load that provides some syntactic sugar for loading CSS and JavaScript files using media queries and browser features. MQSugr was developed as a way for me to learn more about JavaScript.
JavaScript
2
star
13

sump-pumper

A small program for the Spark Core that monitors an attached water sensor.
Arduino
1
star
14

responsive-image-tests

Looking at performance of, primarily, front-end responsive image techniques. Focused on when various page loading events fire as well as overall requests/size.
1
star