h12w / socks

A SOCKS (SOCKS4, SOCKS4A and SOCKS5) Proxy Package for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request stuck at ReadAll

firstrow opened this issue · comments

For some reason code got freeze on method

func readAll(conn net.Conn) (resp []byte, err error)

I tested my proxy, and also bunch of others - same result.
Here is my code:

package main

import (
    "h12.me/socks"
    "log"
)

func main() {
    server := "x.x.x.x:9999"
    proxyServer := "x.x.x.x:8888" // TinyProxy, Socks5

    f := socks.DialSocksProxy(socks.SOCKS5, proxyServer)

    conn, err := f("tcp", server)

    if err != nil {
        log.Println("err", err)
    }
    conn.Write([]byte("Hello")) # This line is never reached
    defer conn.Close()
}

Any ideas? Thanks.

Also tested socks4 - it just works fine.

I have tested the code of SOCK5 again using the example in README.md, and it just works as I have expected. Just make sure you have a SOCK5 proxy with anonymous authentication.

Thanks for the answer. socks uses "Allow x.x.x.x". and have no idea why at your machine it worked.

Ok, looks like this is my and a bunch of others tinyproxy issue. connectiong to TOR network worked well.