1// Package embedded implements process interfaces for statically linked,
2// embedded Tor. Note, processes created here are not killed when a context is
3// done like w/ os.Exec.
4//
5// Usage
6//
7// This package can be used with CGO to statically compile Tor. This package
8// expects https://github.com/cretz/tor-static to be cloned at
9// $GOPATH/src/github.com/cretz/tor-static as if it was fetched with go get. To
10// build the needed static libs, follow the README in that project. Once the
11// static libs are built, this uses CGO to statically link them here. For
12// Windows this means something like http://www.msys2.org/ needs to be
13// installed with gcc.exe on the PATH (i.e. the same gcc that was used to build
14// the static Tor lib).
15//
16// The default in here is currently for Tor 0.3.3.x which uses the tor-0.3.3
17// subdirectory. A different subdirectory can be used for a different version.
18// Note that the current version doesn't support
19// process.Process.EmbeddedControlConn().
20package embedded
21
22import (
23	"github.com/cretz/bine/process"
24
25	tor033 "github.com/cretz/bine/process/embedded/tor-0.3.3"
26)
27
28// NewCreator creates a process.Creator for statically-linked Tor embedded in
29// the binary.
30func NewCreator() process.Creator {
31	return tor033.NewCreator()
32}
33