asdf
This commit is contained in:
parent
6554299a18
commit
2bf5c0ff99
BIN
lib/libs.zip
BIN
lib/libs.zip
Binary file not shown.
38
main.go
38
main.go
@ -4,29 +4,46 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/cretz/bine/process/embedded"
|
||||
"git.tcp.direct/kayos/zwrap"
|
||||
"github.com/cretz/bine/tor"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"git.tcp.direct/kayos/door5/logger"
|
||||
)
|
||||
|
||||
type Knobs struct {
|
||||
conf tor.ListenConf
|
||||
log zwrap.Logger
|
||||
tor.Tor
|
||||
}
|
||||
type BlueDoor struct {
|
||||
conf *Knobs
|
||||
listeners []net.Listener
|
||||
localPaths []string
|
||||
}
|
||||
|
||||
func MemoryMapOSFolder() (path string, err error) {
|
||||
// create memory mapped folder for tor data directory (linux)
|
||||
// un
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func NewListener(listen string) (net.Listener, error) {
|
||||
l, err := net.Listen("tcp", listen)
|
||||
if err != nil {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func NewOnion() (*tor.Tor, error) {
|
||||
log := logger.Get()
|
||||
|
||||
log.Logger.Info().Msg("starting and registering onion service...")
|
||||
|
||||
t, err := tor.Start(nil, &tor.StartConf{
|
||||
ProcessCreator: embedded.NewCreator(),
|
||||
UseEmbeddedControlConn: true,
|
||||
RetainTempDataDir: false,
|
||||
DebugWriter: logger.Get().With().Str("module", "tor").Logger(),
|
||||
|
||||
@ -47,7 +64,20 @@ func NewOnion() (*tor.Tor, error) {
|
||||
defer listenCancel()
|
||||
|
||||
// Create a v3 onion service to listen on any port but show as 80
|
||||
onion, err := t.Listen(listenCtx, &tor.ListenConf{RemotePorts: []int{80}})
|
||||
onion, err := t.Listen(listenCtx, &tor.ListenConf{
|
||||
LocalPort: 0,
|
||||
LocalListener: nil,
|
||||
RemotePorts: []int{80},
|
||||
Key: nil,
|
||||
Version3: false,
|
||||
ClientAuths: nil,
|
||||
MaxStreams: 0,
|
||||
DiscardKey: false,
|
||||
Detach: false,
|
||||
NonAnonymous: false,
|
||||
MaxStreamsCloseCircuit: false,
|
||||
NoWait: false,
|
||||
})
|
||||
if err != nil {
|
||||
log.Panicf("Unable to create onion service: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user