https://github.com/yaproxy/libyap
Proxy Library for Golang
https://github.com/yaproxy/libyap
golang library proxy
Last synced: 6 months ago
JSON representation
Proxy Library for Golang
- Host: GitHub
- URL: https://github.com/yaproxy/libyap
- Owner: yaproxy
- License: apache-2.0
- Created: 2017-03-31T07:15:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-15T12:35:57.000Z (almost 4 years ago)
- Last Synced: 2023-07-27T22:49:11.482Z (almost 3 years ago)
- Topics: golang, library, proxy
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang Library powered by Yaproxy
## Package Proxy
Package proxy provides support for a variety of protocols to proxy network data.
### Example
* Basic Usage
```
import "github.com/yaproxy/libyap/proxy"
...
func X() {
fixedURL := "http://username:password@proxy.site" // HTTP Proxy
//fixedURL := "https://username:password@proxy.site" // HTTPS Proxy
//fixedURL := "sock5://username:password@proxy.site" // sock5 Proxy
// customize your dialer
dialer := &net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}
newDialer, err := proxy.FromURL(fixedURL, dialer, nil)
conn, err := newDialer.Dial("tcp", "google.com:443")
// use the tcp connection
...
}
```