Skip to content

tcp.go:67: failed to get target address: SOCKS error: 8 #252

Description

@MrDkVV

Describe the bug
The application should not "Fail" when "Good" configuration is used.

Background:

  1. CentOS 9
  2. Go
  3. go-ShadowSocks2
    ( All ^^^ installed today, latest release. )
    3 ens9f0 Internet
    4 ens9f1 IP no rougting

To Reproduce
Steps to reproduce the behavior:

  1. From Cento boot to shell / login.
  2. Forwarding rules:

iptables -t nat -A PREROUTING -i ens9f1 -p tcp -j REDIRECT --to-port 12345
iptables -t nat -A PREROUTING -i ens9f1 -p udp -j REDIRECT --to-port 12345
iptables -t nat -A POSTROUTING -o ens9f1 -j MASQUERADE
iptables -t nat -L

  1. Listen on ens9f1 on port 12345 and forward out socks requests to 10.10.10.138:58888 :
    go-shadowsocks2 -verbose -c '10.10.10.138:58888' -socks ':12345'

  2. Flow TCP traffic from another PC attached to ens9f1 as gateway.

  3. each flow creates error.

"2024/01/30 02:22:32 tcp.go:67: failed to get target address: SOCKS error: 8"

Expected behavior

go-shadowsocks2 -verbose -c '10.10.10.138:58888' -socks ':12345'
2024/01/30 02:22:24 tcp.go:18: SOCKS proxy :12345 <-> 10.10.10.138:58888
2024/01/30 02:22:25 tcp.go:18: SOCKS proxy :12345 <-> 10.10.10.138:58888 - Connected ???

Unexpected
go-shadowsocks2 -verbose -c '10.10.10.138:58888' -socks ':12345'
2024/01/30 02:22:24 tcp.go:18: SOCKS proxy :12345 <-> 10.10.10.138:58888
2024/01/30 02:22:32 tcp.go:67: failed to get target address: SOCKS error: 8
socks.pcap.zip

Screenshots
image

Desktop (please complete the following information):

  • OS: Centos 9

Please let me know if anything more is needed.

I also tried -redir in replacement of -socks

go-shadowsocks2 -verbose -c '10.10.10.138:58888' -redir ':12345'
2024/01/30 02:33:49 tcp_linux.go:20: TCP redirect :12345 <-> 10.10.10.138:58888
2024/01/30 02:33:55 tcp.go:87: proxy 192.168.12.5:58041 <-> 10.10.10.138:58888 <-> 192.168.222.130:443
2024/01/30 02:33:55 tcp.go:87: proxy 192.168.12.5:58040 <-> 10.10.10.138:58888 <-> 192.168.222.130:443
2024/01/30 02:33:56 tcp.go:87: proxy 192.168.12.5:58042 <-> 10.10.10.138:58888 <-> 192.168.222.130:443
2024/01/30 02:33:57 tcp.go:87: proxy 192.168.12.5:58043 <-> 10.10.10.138:58888 <-> 192.168.222.130:443
redir.pcap.zip

but getting a relay error as suspected not being socks5 ...

Activity

  1. MrDkVV commented on Jul 15, 2024

    @MrDkVV
    Author

    I'm having the same type of issue

    go-shadowsocks2 -verbose -c 'socks4://10.10.10.10:58888' ...
    go-shadowsocks2 -verbose -c 'socks5://10.10.10.10:58888' ...
    go-shadowsocks2 -verbose -c 'socks5://abc:edf@10.10.10.10:58888' ...

    All of the above we may expect to work but fails, please help?

  2. yangxiaotian-kody commented on Nov 10, 2024

    @yangxiaotian-kody

    I also ecountered this problem, i tried both on win10 and centos, my command is

    go-shadowsocks2 -c "ss://AEAD_CHACHA20_POLY1305:password@host:8488" -verbose -socks :1080

    2024/11/10 16:50:12 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:12 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:12 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:12 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8
    2024/11/10 16:50:17 tcp.go:67: failed to get target address: SOCKS error: 8

  3. pgswow commented on Mar 4, 2025

    @pgswow

    @XSky309 @MrDkVV Hello! Were you able to resolve the issue with the error "failed to get target address: SOCKS error: 8" ?

  4. pgswow commented on Mar 4, 2025

    @pgswow

    its a problem in Google Crome, if i use Firefox - this problem does not appear

  5. MrDkVV commented on Mar 5, 2025

    @MrDkVV
    Author
  6. pgswow commented on Mar 6, 2025

    @pgswow

    The problem continues, firefox or chrome or edge ...
    I've since moved to an alternative project as one does not seem to work and
    very slow support.
    …

    On Tue, Mar 4, 2025 at 8:38 AM pgswow @.***> wrote:
    its a problem in Google Crome, if i use Firefox - this problem does not
    appear

    —
    Reply to this email directly, view it on GitHub
    <#252 (comment)>,
    or unsubscribe
    https://github.com/notifications/unsubscribe-auth/ATVFI2RV7EKEAGHBWHA7VYT2SWUGHAVCNFSM6AAAAABCQXX6VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJXGYYTQNRQGU
    .
    You are receiving this because you were mentioned.Message ID:
    @.***>
    [image: pgswow]pgswow left a comment (shadowsocks/go-shadowsocks2#252)
    <#252 (comment)>

    its a problem in Google Crome, if i use Firefox - this problem does not
    appear

    —
    Reply to this email directly, view it on GitHub
    <#252 (comment)>,
    or unsubscribe
    https://github.com/notifications/unsubscribe-auth/ATVFI2RV7EKEAGHBWHA7VYT2SWUGHAVCNFSM6AAAAABCQXX6VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJXGYYTQNRQGU
    .
    You are receiving this because you were mentioned.Message ID:
    @.***>

    please send me name alternative project in private message, or this

  7. zhang-jingwang commented on Dec 13, 2025

    @zhang-jingwang

    I've met the same problem when I using this on WIndows 7. After some investigation, I think the reasons are:

    1. go-shadowsocks2 does not support SOCKS v4. It only support SOCKS v5.
    2. Windows 7 proxy using SOCK v4.
    3. I downloaded a firefox and it supports proxy with SOCKS v5, it works perfectly.

    Just for your information. Please check the SOCKS version to avoid the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions