mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-12 23:36:55 +08:00
feat(proxy): add proxy module
This commit is contained in:
19
proxy/single_provider.go
Normal file
19
proxy/single_provider.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package proxy
|
||||
|
||||
// SingleProxyProvider 单个代理提供者(不使用IP池)
|
||||
type SingleProxyProvider struct {
|
||||
proxyURL string
|
||||
}
|
||||
|
||||
// NewSingleProxyProvider 创建单个代理提供者
|
||||
func NewSingleProxyProvider(proxyURL string) *SingleProxyProvider {
|
||||
return &SingleProxyProvider{proxyURL: proxyURL}
|
||||
}
|
||||
|
||||
func (p *SingleProxyProvider) GetIPList() ([]ProxyIP, error) {
|
||||
return []ProxyIP{{IP: p.proxyURL}}, nil
|
||||
}
|
||||
|
||||
func (p *SingleProxyProvider) RefreshIPList() ([]ProxyIP, error) {
|
||||
return p.GetIPList()
|
||||
}
|
||||
Reference in New Issue
Block a user