Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gotsocks

Execute command with tsocks(a transparent SOCKS proxy library) in golang

Installation

Install tsocks:

For Ubuntu/Debian

apt-get install tsocks

For CentOS/Fedora

yum install tsocks

Install gotsocks:

go get github.com/joeguo/gotsocks

Example

package main

import (
"fmt"
"github.com/joeguo/gotsocks"
)

func main() {
    proxy, err := gotsocks.New("198.xx.xx.xx:12345", gotsocks.Socks5)
	if err != nil {
		fmt.Println(err)
		return
	}
	result, err := proxy.Command("/usr/bin/whois", 10, "google.com")
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(string(result))
}

About

Execute command with tsocks(a transparent SOCKS proxy library) in golang

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages