Skip to content

Commit 14382c6

Browse files
authored
Proxy port int conv trim fix
1 parent c761038 commit 14382c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

http.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (p *Proxy) CheckProxyHTTP(proxy string) {
7575
var proxyPort = *port
7676
s := strings.Split(proxy, ":")
7777
if len(s) > 1 {
78-
proxyPort, err = strconv.Atoi(s[1])
78+
proxyPort, err = strconv.Atoi(strings.TrimSpace(s[1]))
7979
if err != nil {
8080
log.Println(err)
8181
return
@@ -149,7 +149,7 @@ func (p *Proxy) CheckProxySocks4(proxy string) {
149149
var proxyPort = *port
150150
s := strings.Split(proxy, ":")
151151
if len(s) > 1 {
152-
proxyPort, err = strconv.Atoi(s[1])
152+
proxyPort, err = strconv.Atoi(strings.TrimSpace(s[1]))
153153
if err != nil {
154154
log.Println(err)
155155
return
@@ -204,7 +204,7 @@ func (p *Proxy) CheckProxySocks5(proxy string) {
204204
var proxyPort = *port
205205
s := strings.Split(proxy, ":")
206206
if len(s) > 1 {
207-
proxyPort, err = strconv.Atoi(s[1])
207+
proxyPort, err = strconv.Atoi(strings.TrimSpace(s[1]))
208208
if err != nil {
209209
log.Println(err)
210210
return

0 commit comments

Comments
 (0)