Skip to content

ralfonso-directnic/mallory

 
 

Repository files navigation

mallory

Simple HTTP/HTTPS proxy uses SSH.

Installation

  • Local machine: go get github.com/justmao945/mallory/cmd/mallory
  • Remote server: need our old friend sshd

Configueration

Config file

Default path is $HOME/.config/mallory.json, can be set when start program

mallory -config path/to/config.json

Content:

  • id_rsa is the path to our private key file, can be generated by ssh-keygen
  • local_smart is the local address to serve HTTP proxy with smart detection of destination host
  • local_normal is similar to local_smart but send all traffic through remote SSH server without destination host detection
  • remote is the remote address of SSH server
  • blocked is a list of domains that need use proxy, any other domains will connect to their server directly
{
  "id_rsa": "$HOME/.ssh/id_rsa",
  "local_smart": ":1315",
  "local_normal": ":1316",
  "remote": "ssh://user@vm.me:22",
  "blocked": [
    "angularjs.org",
    "golang.org",
    "google.com",
    "google.co.jp",
    "googleapis.com",
    "googleusercontent.com",
    "google-analytics.com",
    "gstatic.com",
    "twitter.com",
    "youtube.com"
  ]
}

System config

  • Set both HTTP and HTTPS proxy to localhost with port 1315 to use the block list
  • Set env var http_proxy and https_proxy to localhost:1316 if is in terminal

TODO

  • return http error when unable to dial
  • add host to list automatically when unable to dial

About

Simple HTTP/HTTPS proxy uses SSH

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%