wisprgo

package module
v0.0.0-...-5a3b80c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2015 License: MIT Imports: 14 Imported by: 0

README

WisprGo

WisprGo is a set of tools to provide a wifi AP with Wispr functionalities, to make it simple Wispr is the protocol that show you a popup when you are entering a free wifi provider (Starbucks, McDonalds ...).
We need this popup to redirect the user to a page showing it works, cause mostly all the traffic is now secure HTTP there is no way to intercept the calls with the right certificate, so the user may think your AP isn't working.

WisprGo isn't dedicated to provide security, the main goal is to provide a free wifi access portal with popup and without password, but it can be extended to do so.
The Wispr protocol and the way manufacturers test the connection and display this popup are largely undocumented, I hope we can collect those for this project.

WisprGo comes with a command line tool: wisprproxy that you can run on your network, it can replace Nginx as a webserver, reverse proxy server & Wispr proxy.

Status

The current version so far, displays a popup on iOS, No popup for Android yet but still intercept all the traffics and display a login page.
It's a work in progess further enhancements are coming, like choosing the redirections URLs & customizing the pages, I'm releasing it early to get some help with Android and Microsoft harware.

Usage
wproxy := wisprgo.NewWisprProxy()
wproxy.AddReverseProxyRule("www.google.com", `(?i)yahoo\.com/.*`)
wproxy.AddReverseProxyRule("localhost:8000", `(?i)wikipedia.wifi`)
wproxy.AddFileServer("/tmp", "home.wifi")

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
    wproxy.ServeHTTP(w, r)
})
log.Fatal(http.ListenAndServe(":80", nil))

This will create a reverse proxy server on port 80, that:

  • reverse proxy all traffic from *yahoo.com to www.google.com
  • reverse proxy all traffic for wikipedia.wifi to localhost on port 8000
  • serves the website home.wifi from the pages in /tmp
  • catch all the traffic coming through it and display a login page to any users who has not click on the submit button.
Network

For wisprproxy to work you have to redirect all traffic through it.
No need for NAT nor routing just set up a dnsmasq with a wildcard domain:
address=/#/10.4.0.1

An example configuration is explained on this blog post.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WisprProxy

type WisprProxy struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewWisprProxy

func NewWisprProxy() *WisprProxy

func (*WisprProxy) AddFileServer

func (w *WisprProxy) AddFileServer(path, hostname string)

func (*WisprProxy) AddReverseProxyRule

func (w *WisprProxy) AddReverseProxyRule(h string, regexps ...string)

func (*WisprProxy) Allow

func (w *WisprProxy) Allow(h string)

func (*WisprProxy) IsAllowed

func (w *WisprProxy) IsAllowed(h string) bool

func (*WisprProxy) Process

func (w *WisprProxy) Process(sourceReq *http.Request, destReq *http.Request)

func (*WisprProxy) RoundTrip

func (w *WisprProxy) RoundTrip(r *http.Request) (*http.Response, error)

func (*WisprProxy) ServeHTTP

func (w *WisprProxy) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL