Skip to content

choonkeat/sotong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

“Sotong” is yet another Ruby proxy server.

  1. easily modify any HTTP response before reaching my browser

  2. quick edit-save-refresh cycle

  3. avoid installing mouseHole & reading its documents

  1. Set your browser to use a proxy at localhost:12345

  2. Execute command:

$ ruby sotong.rb
Proxy ready on 0.0.0.0:12345. Ctrl-C to quit.

To do more than just web proxy, add some arguments to the shell command:

ruby sotong.rb <url regexp> <ruby script> [<url regexp> <ruby script> [<url regexp> <ruby script> ...]]

The following command will run “scripts/google.rb” for any URL matching “google-analytics”

$ ruby sotong.rb google-analytics scripts/google.rb
URLs matching /google-analytics/ will trigger script "scripts/google.rb"
Proxy ready on 0.0.0.0:12345. Ctrl-C to quit.

The following command will also run “scripts/nocache.rb” for any URL matching “swf”

$ ruby sotong.rb google-analytics scripts/google.rb swf scripts/nocache.rb
URLs matching /google-analytics/ will trigger script "scripts/google.rb"
URLs matching /swf/ will trigger script "scripts/nocache.rb"
Proxy ready on 0.0.0.0:12345. Ctrl-C to quit.

See scripts/inspect.rb

  1. Setup your browser to use proxy at 0.0.0.0:12345

  2. Run sotong with “scripts/highlight-my-tweets.rb”

$ ruby sotong.rb twitter.com/home scripts/highlight-my-tweets.rb
URLs matching /twitter.com/home/ will trigger script "scripts/highlight-my-tweets.rb"
Proxy ready on 0.0.0.0:12345. Ctrl-C to quit.
  1. Point your browser to twitter.com/home

  2. You should see your own tweets in yellow background.

This is just a simple illustration of what you can do

1. tweak even when server-side environment is not accessible
2. experiment without requiring firebug
3. not limited to document.ready, javascript changes. e.g. http headers: gzip? resize image?

About

yet another Ruby proxy server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages