killswitch

package module
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

README

killswitch

VPN kill switch for macOS (Mac OS X >= 10.6), it will block outgoing traffic when VPN connection fails or crashes.

https://vpn-kill-switch.com/

Usage:

$ killswitch

To enable:

$ sudo killswitch -e

To disable:

$ sudo killswitch -d

Compile from source

Setup go environment https://golang.org/doc/install

For example using $HOME/go for your workspace

$ export GOPATH=$HOME/go

Clone project into that directory:

$ go get github.com/vpn-kill-switch/killswitch

Build by just typing make:

$ cd $GOPATH/src/github.com/vpn-kill-switch/killswitch
$ make

Documentation

Index

Constants

UGSH, UGSc man netstat

Variables

This section is empty.

Functions

func Green

func Green(s string) string

Green return string in green

func Red

func Red(s string) string

Red return string in red

func UGSX

func UGSX() (net.IP, error)

UGSX find IP of the vpn by matching existing route flags, man netstat

func WhoamiDNS

func WhoamiDNS() (string, error)

WhoamiDNS return public ip by quering DNS server

func WhoamiWWW

func WhoamiWWW() (string, error)

WhoamiWWW return IP by quering http server

func Yellow

func Yellow(s string) string

Yellow return string in yellow

Types

type Network

type Network struct {
	Interfaces    []net.Interface
	UpInterfaces  map[string][]string
	P2PInterfaces map[string][]string
	PeerIP        string
	PFRules       bytes.Buffer
}

Network struct

func New

func New(peerIP string) (*Network, error)

New returns a Network struct

func (*Network) CreatePF

func (n *Network) CreatePF(leak, local bool)

CreatePF creates a pf.conf

func (*Network) GetActive

func (n *Network) GetActive() error

GetActive finds active interfaces

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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