[WIP] gg is a portable tool to redirect the traffic of a given program to your modern proxy without installing any other programs.

gg

gg (go-graft), was inspired by graftcp. go-graft is a pure golang implementation with more useful features.

TODO:

  1. Use system DNS as the fallback.
  2. Restore the IP of connect that family is AF_LINKLAYER and others.
  3. User-friendly settings.
Owner
mzz
猫主子 | keep humble and hungry | 我计网挂科
mzz
Comments
  • arm64 error

    arm64 error

    9% [Working]panic: interface conversion: *shadowsocksr.SSTCPConn is not net.PacketConn: missing method ReadFrom
    
    goroutine 287 [running]:
    github.com/mzz2017/gg/proxy.(*Proxy).GetOrBuildUDPConn(0x40001b7500, {0x8bea40, 0x400028cff0}, {0x7a4bce, 0xa}, {0x400011e500, 0x2a, 0x40})
    	github.com/mzz2017/gg/proxy/udp.go:181 +0x4fc
    github.com/mzz2017/gg/proxy.(*Proxy).handleUDP(0x40001b7500, {0x8bea40?, 0x400028cff0}, {0x400011e500, 0x2a, 0x40})
    	github.com/mzz2017/gg/proxy/udp.go:79 +0x2b4
    github.com/mzz2017/gg/proxy.(*Proxy).ListenUDP.func1()
    	github.com/mzz2017/gg/proxy/proxy.go:148 +0x48
    created by github.com/mzz2017/gg/proxy.(*Proxy).ListenUDP
    	github.com/mzz2017/gg/proxy/proxy.go:147 +0x288
    
  • 可以在docker的centos中使用吗?

    可以在docker的centos中使用吗?

    我尝试在linux的docker中使用,docker容器的系统是centos,当我使用您的go.sh,用命令./go.sh,出现如下错误 curl: (60) SSL certificate problem: certificate has expired More details here: https://curl.haxx.se/docs/sslcerts.html

    curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.

  • Failed to Redirect UDP Connection

    Failed to Redirect UDP Connection

    UDP conns can't be redirected to my socks5 node, listened by trojan-go v0.10.6. gg says the server doesn't support it.

    I tried a transproxy and confirmed that there is no problem with the UDP support of my trojan-go node.

    As for gg, It runs in this way:

    ❯ gg -vv curl ip.sb
    TRAC[0000] Version: 0.2.3                               
    TRAC[0000] OS/Arch: linux/amd64                         
    TRAC[0000] Using config file: /home/user1/.ggconfig.toml 
    TRAC[0000] Config:
    no_udp=false
    test_node_before_use=true
    subscription.link=
    subscription.select=first
    subscription.cache_last_node=true
    node=socks5://localhost:7891
    cache.subscription.last_node= 
    INFO[0000] Your proxy server does not support UDP, so we will not redirect UDP traffic. 
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 4                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] network: unknown: family: 1, type: 526337    
    TRAC[0000] new socket (): pid: 9521, fd 3               
    TRAC[0000] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9521, fd: 3 
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] network: unknown: family: 1, type: 526337    
    TRAC[0000] new socket (): pid: 9521, fd 3               
    TRAC[0000] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9521, fd: 3 
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] new socket (udp): pid: 9521, fd 3            
    TRAC[0000] close: pid: 9521, fd 3                       
    TRAC[0000] network: unknown: family: 1, type: 526337    
    TRAC[0000] new socket (): pid: 9522, fd 7               
    TRAC[0000] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 7 
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] network: unknown: family: 1, type: 526337    
    TRAC[0000] new socket (): pid: 9522, fd 7               
    TRAC[0000] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 7 
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] network: unknown: family: 1, type: 526337    
    TRAC[0000] new socket (): pid: 9522, fd 7               
    TRAC[0000] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 7 
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] close: pid: 9522, fd 7                       
    TRAC[0000] new socket (udp): pid: 9522, fd 7            
    TRAC[0000] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 7 
    TRAC[0000] syscall.SYS_CONNECT                          
    TRAC[0000] handleINet4 (udp): origin: 1.0.0.1:53, after: 127.0.0.1:22545 
    TRAC[0000] received udp: 127.0.0.1:40836, tgt: 1.0.0.1:53 
    TRAC[0000] hijackDNS: lookup: ip.sb. to 198.18.0.1      
    TRAC[0000] received udp: 127.0.0.1:40836, tgt: 1.0.0.1:53 
    TRAC[0000] hijackDNS: lookup: ip.sb. to 198.18.0.1      
    TRAC[0005] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 7 
    TRAC[0005] syscall.SYS_SENDTO                           
    TRAC[0005] received udp: 127.0.0.1:40836, tgt: 1.0.0.1:53 
    TRAC[0005] hijackDNS: lookup: ip.sb. to 198.18.0.1      
    TRAC[0010] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 7 
    TRAC[0010] syscall.SYS_SENDTO                           
    TRAC[0010] received udp: 127.0.0.1:40836, tgt: 1.0.0.1:53 
    TRAC[0010] hijackDNS: lookup: ip.sb. to 198.18.0.1      
    TRAC[0015] close: pid: 9522, fd 7                       
    TRAC[0015] syscall.SYS_CONNECT, syscall.SYS_SENDTO: pid: 9522, fd: 6 
    TRAC[0015] socketInfo of socket cannot found: pid: 9522, fd: 6 
    TRAC[0015] child 9522 exited                            
    TRAC[0015] close: pid: 9521, fd 6                       
    TRAC[0015] close: pid: 9521, fd 5                       
    curl: (6) Could not resolve host: ip.sb
    TRAC[0015] close: pid: 9521, fd 3                       
    TRAC[0015] close: pid: 9521, fd 4                       
    TRAC[0015] child 9521 exited 
    

    Is there anything wrong? How to fix this? Thanks a lot.

  • 请问已经支持使用https节点了吗? 我直接使用https报错

    请问已经支持使用https节点了吗? 我直接使用https报错

    root@debian11:~# gg --node https://http用户:http密码@测试网址.com:10844 -vv scp -i ~/SCPkey -rp -P 60040 /root root@测试网址.com:/root/123123_test2233 TRAC[0000] Version: v0.2.3
    TRAC[0000] OS/Arch: linux/amd64
    TRAC[0000] Using config file: /root/.ggconfig.toml
    TRAC[0000] Config: test_node_before_use=true node=https://http用户:http密码@测试网址.com:10844 subscription.link= subscription.select=first subscription.cache_last_node=true cache.subscription.last_node= no_udp= FATA[0000] GetDialer:unable to connect to the proxy node: connectivity test failed: Get "https://fonts.gstatic.com/generate_204": tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config root@debian11:~# ^C root@debian11:~#

    经过测试,直接使用http正常,用https节点的话如上报错. https节点是xray开的,http+tls 1.3 image 试着换成最小tls版本1.1也还是不行.

  • git fatal: early EOF

    git fatal: early EOF

    gg git clone [email protected]:xxxxxxxx.git Cloning into 'xxxxxxxx'... remote: Enumerating objects: 1465, done. remote: Counting objects: 100% (589/589), done. remote: Compressing objects: 100% (269/269), done. ssh_dispatch_run_fatal: Connection to 127.0.0.2 port 40931: message authentication code incorrect fatal: the remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed

  • 'gg config -w subscription=' would fail to add subscription in zsh on arch linux host

    'gg config -w subscription=' would fail to add subscription in zsh on arch linux host

    I'm using zsh in my terminal.

    $ gg --version
    gg version 0.2.1
    

    gg is fine, but when I add my subscription as document says:

    $ gg config -w subscription='My link'
    

    would result this error

    zsh: no matches found: 'My link'
    

    However, this problem seems fine with bash, I can add My link to gg in bash without any problem. I'm not sure if this error is repeatable 'cause for now I'm just having one arch laptop. Could you kindly check it? Thanks a lot.

  • 使用局域网内其它机器提供的socks5代理时报错

    使用局域网内其它机器提供的socks5代理时报错

    gg config -w node=socks://MTkyLjE2OC41LjIxOjEwODA4 配置后,用 gg curl ipv4.appspot.com 测试,报错 FATA[0000] GetDialer:invalid parameters

    此socks5代理在同一局域网,可以正常访问

  • fix: skip fakeIP for ICMP

    fix: skip fakeIP for ICMP

    1. Fix ICMP forwarding problem
    2. Add mapper of fake IP to real IP
    3. Save real IP every time a request is sent, and restore real IP every time it is not TCP and UDP
  • [BUG] It may encounter DNS pollution when using local DNS services

    [BUG] It may encounter DNS pollution when using local DNS services

    当用户使用本地 DNS 服务 如 systemd-resolved 时,他们会遇到 DNS 污染。 When someone uses local DNS services like systemd-resolved, they may encounter DNS pollution.

    在详细的日志中可以看到 skip loopback: 127.0.0.53:53 的输出。 In verbose mode, it outputs: skip loopback: 127.0.0.53:53

  • go 1.19 下编译产物无法运行

    go 1.19 下编译产物无法运行

    运行 archlinuxcn 上打包的 gg 提示如下内容且无法运行:

    panic: Something in this program imports go4.org/unsafe/assume-no-moving-gc to declare that it assumes a non-moving garbage collector, but your version of go4.org/unsafe/assume-no-moving-gc hasn't been updated to assert that it's safe against the go1.19 runtime. If you want to risk it, run with environment variable ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.19 set. Notably, if go1.19 adds a moving garbage collector, this program is unsafe to use.
    
    goroutine 1 [running]:
    go4.org/unsafe/assume-no-moving-gc.init.0()
            go4.org/unsafe/[email protected]/untested.go:25 +0x1f4
    

    按提示添加 ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.19 到环境变量仍可正常使用。

    手动构建 main 分支报错相同,发行版为 Manjaro Linux 的 unstable 频道。

  • gg docker pull

    gg docker pull

    gg config -w node=socks://192.168.1.33:7890
    gg config
    sudo -E gg -vv docker pull gcr.io/google-containers/busybox:latest
    
    
    # 报错日志如下
    
    
    Error response from daemon: Get "https://gcr.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
    TRAC[0016] PtraceGetRegs: no such process               
    TRAC[0016] child 229620 exited                          
    TRAC[0016] child 229619 exited                          
    TRAC[0016] child 229618 exited                          
    TRAC[0016] child 229617 exited                          
    TRAC[0016] child 229616 exited                          
    TRAC[0016] child 229615 exited                          
    TRAC[0016] child 229612 exited
    
    
  • 可否自定义配置节点测速地址?

    可否自定义配置节点测速地址?

    经过测试有很多节点是正常的,但是测速结果是-1ms。目前还不清楚具体原因,我用了1个v2订阅,全部节点测速正常,但是后面我尝试用了3个clash订阅,所有节点都是-1ms,但是实际上clash订阅里的节点都是正常的。在gg终端也是实际可用的,只是测速异常

    感觉下面几个测速地址比较好用,想自定义配置一下 image



    clash订阅我多次测速查看了所有节点都是-1ms (v2订阅的节点测速是正常的), 但是在window多次测速中, 只有2个是挂掉的。在gg终端也是实际可用的,只是测速异常 image

  • WSL Ubuntu

    WSL Ubuntu

    FATA[0000] tracer.Wait:no such process

    NAME="Ubuntu" VERSION="20.04.3 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.3 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

Related tags
A Simple Go proxy to make amazing redirect only with 1 line.

Simple Go Proxy Simple go application that allows you to share your code with a custom domain name instead of github or gitlab links or other git prot

May 18, 2022
A Golang program that receives DNSTAP traffic and relays it to multiple other listeners.

socket-proxy socket-proxy is a Golang program that is used to proxy dnstap messages from one socket to multiple other sockets. Overview Name Servers t

Jan 10, 2022
Undirect - Get redirect link result with golang

Undirect Usage Request http://localhost:5000/?url=https%3A%2F%2Fokjk.co%2FSqOYfk

Jan 12, 2022
Local Portable HTTP/HTTPS Proxy

SkelgoKey Portable Local Web Proxy - Creates a local proxy that bypasses any network certificate checks - USAGES Windows .\SkeletonKey.exe (web addres

Oct 13, 2021
🐶 A modern alternative network traffic sniffer.
🐶  A modern alternative network traffic sniffer.

sniffer A modern alternative network traffic sniffer inspired by bandwhich(Rust) and nethogs(C++). sniffer.mov Introduction 中文介绍 sniffer is designed f

Dec 29, 2022
A minimal analytics package to start collecting traffic data without client dependencies.

go-web-analytics A minimal analytics package to start collecting traffic data without client dependencies. Logging incoming requests import "github.co

Nov 23, 2021
Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, and replay on the go.
Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation, and replay on the go.

Features • Installation • Usage • Running Proxify • Installing SSL Certificate • Applications of Proxify • Join Discord Swiss Army Knife Proxy for rap

Jan 8, 2023
Sep 23, 2022
DeepCopy a portable app that allows you to copy all forms of specified file types from your entire file system of the computer

DeepCopy a portable app that allows you to copy all forms of specified file types from your entire file system of the computer

Dec 20, 2021
Reverse proxy server to filter traffic based on JA3 fingerprint/hash

JA3RP (JA3 Reverse Proxy) Ja3RP is a basic reverse proxy server that filters traffic based on JA3 fingerprints. It can also operate as a regular HTTP

Sep 17, 2022
Simple TCP proxy to visualise NATS client/server traffic
Simple TCP proxy to visualise NATS client/server traffic

NATS uses a simple publish/subscribe style plain-text protocol to communicate between a NATS Server and its clients. Whilst this connection should remain opaque to the user, it can be quite handy to see the data being passed from time to time - this tool does just that (it also saves me loading Wireshark and filtering the NATS traffic).

Jan 15, 2022
🐉 Simple WireGuard proxy with minimal overhead for WireGuard traffic.

swgp-go ?? Simple WireGuard proxy with minimal overhead for WireGuard traffic. Proxy Modes 1. Zero overhead Simply AES encrypt the first 16 bytes of a

Jan 8, 2023
A discord bot that mumbles the audio from another room into your room (WIP)

DiscordGo Voice Receive Example This example experiments with receiving voice data from Discord. It joins a specified voice channel, listens for 10 se

Dec 11, 2021
A base gui tool for xray/v2ray/hysteria/trojan-go without system proxy

A base gui tool for xray/v2ray/hysteria/trojan-go without system proxy

Dec 8, 2022
A service to proxy requests to a given backend service.

Proxy Service A service to proxy requests to a given backend service. Go 1.17+ Clone git clone [email protected]:janu-cambrelen/proxy-service.git Run (L

Jan 5, 2022
rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.
rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.

rconn (r[everse] conn[ection]) is a multiplatform program for creating reverse connections. It lets you consume services that are behind NAT and/or fi

Jan 1, 2023
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.

gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era. Current status: Maintenance mode, accepting PRs. Currently in

Dec 25, 2022