Skip to content

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

Notifications You must be signed in to change notification settings

joeguo/gotsocks

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages