fix(tunnel/tor): keep tunneldir clean (#300)
* fix(tunnel/tor): keep tunneldir clean This diff ensures that we don't keep the log file growing and we also remove the temporary files created by the library we are currently using for running tor from golang. Part of https://github.com/ooni/probe/issues/985 * fix(session.go): tell use we're using a tunnel
This commit is contained in:
parent
6aa2551c43
commit
8b92037ae3
3 changed files with 76 additions and 3 deletions
|
|
@ -168,6 +168,8 @@ func NewSession(ctx context.Context, config SessionConfig) (*Session, error) {
|
|||
if proxyURL != nil {
|
||||
switch proxyURL.Scheme {
|
||||
case "psiphon", "tor", "fake":
|
||||
config.Logger.Infof(
|
||||
"starting '%s' tunnel; please be patient...", proxyURL.Scheme)
|
||||
tunnel, err := tunnel.Start(ctx, &tunnel.Config{
|
||||
Name: proxyURL.Scheme,
|
||||
Session: &sessionTunnelEarlySession{},
|
||||
|
|
@ -178,6 +180,7 @@ func NewSession(ctx context.Context, config SessionConfig) (*Session, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config.Logger.Infof("tunnel '%s' running...", proxyURL.Scheme)
|
||||
sess.tunnel = tunnel
|
||||
proxyURL = tunnel.SOCKS5ProxyURL()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue