Git Product home page Git Product logo

goflyway's Introduction

goflyway v2 - a local port forwarder built on HTTP

master is the active develop branch and containing v2 code, for the stable v1 release (though it was once called v2.0), please refer to v1.0 branch.

goflyway v2 is a special tool to forward local ports to a remote server securly, just like ssh -L.

goflyway uses pure HTTP POST requests to relay TCP connections. There is no CONNECT involved nor needed because goflyway is designed mainly for those people who are behind a CONNECT-less HTTP proxy or want to accelerate connections through static CDNs.

However pure HTTP requesting is definitely a waste of bandwidth if you already have a better network environment, so use -w to turn on WebSocket relay, or -K to turn on KCP relay if possible.

Usage

Forward localhost:1080 to server:1080 through server:80

    Server: ./goflyway :80
    Client: ./goflyway -L 1080::1080 server:80 -p password

Forward localhost:1080 to server2:1080 through server:80 using WebSocket

    Server: ./goflyway :80
    Client: ./goflyway -w -L 1080:server2:1080 server:80 -p password

Dynamically forward localhost:1080 to server:80

    Server: ./goflyway :80
    Client: ./goflyway -D 1080 server:80 -p password

HTTP reverse proxy or static file server on the same port:

    ./goflyway :80 -P http://127.0.0.1:8080 
    ./goflyway :80 -P /var/www/html

Write Buffer

In HTTP mode when server received some data it can't just send them to the client directly because HTTP is not bi-directional, instead the server must wait until the client requests them, which means these data will be stored in memory for some time.

You can use -W bytes to limit the maximum bytes a server can buffer (for each connection), by default it is 1048576 (1M). If the buffer reaches the limit, the following bytes will be blocked until the buffer has free space for them.

goflyway's People

Contributors

ali5h avatar coyove avatar ishanray avatar jostyee avatar seemethere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goflyway's Issues

换了VPS后客户端无法起作用

大神您好,换了VPS后在VPS安装启动goflyway正常,输入service goflyway status后也显示goflyway (pid 385)正在运行。。。但是客户端无论是使用bat还是把goflyway.exe放到windows/system32里用命令行手输启动,虽然命令行会提示hi!nudafi, proxy is listening at :8100, up stream is vps id:2333,但是ie设置http代理为127.0.0.1:8100后显示internet无法显示该网页,百思不得其解,找不到恢复办法,望解答,谢谢。

使用疑问

使用步骤是这样吗:
1.先在VSP上go run main.go -k=abcd11跑起来
2.然后在本地计算机go run main.go -k=KEY -up=VPS_IP:172.2.3.4:8100,VPS_是直接写8100还是IP地址+8100?
3.然后在IE中设置127.0.0.1:8100代理

Cannot build go flyway

hello sir i have this error when i try github.com/coyove/tcpmux
goworkspace/src/github.com/coyove/tcpmux/dial.go:24:4: undefined: rand.Rand
Sir is it possible to give binary release for 32 bit linux please

下载大文件出现断流现象

下载时会出现速度突然变为0的情况,变为0后浏览器也无法走代理,就是“假死”状态。虽然解决办法是停掉下载器等一分钟就能自动恢复,但因为出现频率较高,几乎每个文件下载时都有至少一次的断流,有什么方法可以解决,估计把tcpdeadline设成0?软件支持这么做吗?
服务端:centos6和Ubuntu14均有
版本:releast 1.1.0(linux64位)
客户端:windows 10 64位
服务端运行指令:nohup ./goflyway -k="密码" -l=":8100" > /tmp/goflyway.log 2>&1 &
客户端指令:goflyway.exe -k="密码" -up="服务器:端口" -l=":8100"
pause>nul
下载软件:IDM(8线程16线程均发生,其他的没试)
文件大小:4G左右
tips:下载文件时同时用浏览器走代理上网更容易发生此情况

求-acl <acl_config>的具体用法

windows 10环境,如果用acl4ssr规则的话,仅需要在windows客户端启动参数里面加上-acl么?acl_config指的是acl规则在windows中的绝对路径么?acl4ssr中的所有acl规则都是支持的么?
求解。

安装失败

安装时提示在github.com/coyove/tcpmux/dial.go的第24行使用的rand.Rand未定义
查询import部分,发现并未include系统的math/rand,而是引用了手写的goflyway/blob/master/pkg/rand/
但是在rand.go文件中并未找到对于Rand方法的声明

怎么设置本地代理?

我是这样设置的:

服务端:

[root@hello ~]# /var/www/goflyway_linux_amd64/goflyway -k=hello12345
     __//                   __ _
    /.__.\                 / _| |
    \ \/ /      __ _  ___ | |_| |_   ___      ____ _ _   _
 '__/    \     / _' |/ _ \|  _| | | | \ \ /\ / / _' | | | |
  \-      )   | (_| | (_) | | | | |_| |\ V  V / (_| | |_| |
   \_____/     \__, |\___/|_| |_|\__, | \_/\_/ \__,_|\__, |
 ____|_|____    __/ |             __/ |               __/ |
     " "  cf   |___/             |___/               |___/
 
[  1017 01:22:19.824] Hi! Benadit, server is listening at :8100

客户端:

dell@DESKTOP-OKFHT30 MINGW64 ~
$ D:/goflyway/goflyway_windows_amd64/goflyway -up=47.xx.xx.xx:8100 -k=hello12345
     __//                   __ _
    /.__.\                 / _| |
    \ \/ /      __ _  ___ | |_| |_   ___      ____ _ _   _
 '__/    \     / _' |/ _ \|  _| | | | \ \ /\ / / _' | | | |
  \-      )   | (_| | (_) | | | | |_| |\ V  V / (_| | |_| |
   \_____/     \__, |\___/|_| |_|\__, | \_/\_/ \__,_|\__, |
 ____|_|____    __/ |             __/ |               __/ |
     " "  cf   |___/             |___/               |___/

[W 1017 01:31:31.101] cannot read chinalist.txt (but it's fine, you can ignore this msg)
[  1017 01:31:31.304] Hi! Benadit, proxy is listening at :8100, upstream is 47.xx.xx.xx:8100




本地代理:在win10中这样设置的

2017-10-17_1-50-34

问题:
浏览器可以打开网页,但是在命令行执行npm install安装某个包,却仍然连不上。要怎么做才可以?

用编译后的版本,无法连接

在vps上和Windows上分别安装编译后的程序,并启动了程序,
[root@host goflyway]# ./goflyway
// __ _
/.
.\ / | |
\ / / __ _ ___ | |
| |_ ___ ____ _ _ _
'/ \ / ' |/ _ | | | | | \ \ /\ / / ' | | | |
- ) | (
| | (
) | | | | |
| |\ V V / (| | || |
____/ _, |_
/|| ||_, | _/_/ _,|_, |
||_ / | / | / |
" " cf |
/ |
/ |___/

[WARNING] you are using the default key (-k key)
listening on :8100

浏览器设置为http代理 127.0.0.1:8100

可是上不了网
无法访问此网站

网址为 https://www.google.com/ 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。
ERR_TUNNEL_CONNECTION_FAILED

我在ubuntu的客户端运行一段时间后自动关闭,第一版似乎没那么容易关。以后更新每次我都重新编译,但是没有一次能坚持一天。

服务端倒是没有自动关闭。我查看了log发现如下
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x4743f9]

goroutine 58029 [running]:
panic(0x709a80, 0xc4200120a0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/coyove/goflyway/proxy.(*prefetchReader).readTimeout.func1(0xc422b014b0, 0xc422b014c0, 0xc4218de400, 0xc421434340, 0x1, 0x1, 0xc4225fe770)
/home/sky/work/soft/go/src/github.com/coyove/goflyway/proxy/multiplexer.go:28 +0x29
created by github.com/coyove/goflyway/proxy.(*prefetchReader).readTimeout
/home/sky/work/soft/go/src/github.com/coyove/goflyway/proxy/multiplexer.go:30 +0x106

arm客户端

本人go小白,在release版本中能否加入arm版的?

panic: runtime error: index out of range

debian 8.9,
运行:
./goflyway -k hello

报错:
panic: runtime error: index out of range
goroutine 1 [running]:
main.main()
/var/www/goflyway/main.go:47 +0xb33

是否可以或者已经支持绑定域名+反向代理方式伪装?

我在想,如果Goflyway可以绑定域名,然后再配置一个反向代理某个HTTP网站,然后再套个CF CDN,最后客户端直接连接就是代理,访问域名就是反向代理的网站,感觉可以骗骗GFW什么的。
目前我试了试好像不能绑定域名,所以反向代理都是域名替换为当前服务器IP。。。感觉有点假。

能编译一个linux arm32的版本吗?

如题,我自己在ubuntu 16.4和windows 10中编译都无法通过,显示如下错误:
C:\Users\xwfunny>go build github.com/coyove/goflyway/cmd/goflyway
github.com/coyove/tcpmux
go\src\github.com\coyove\tcpmux\dial.go:24:4: undefined: rand.Rand

所以想请问大神能不能编译一个linux arm32的版本?谢谢!

客户端域名支持

客户端-up后能否加域名与端口,能否通过cloudflare来隐藏vps真实ip

goflyway使用如何让我不需要客户端和vps手动开启服务才能使用

goflyway用了几天了,感觉速度还是不错。以下几个疑问请教大家:
1.goflyway是不是特征特别明显,加密方式是否可以放心使用?
2.我需要手动两边开启服务,能不能vps服务器保持开启开机自启,然后后台运行?
比如写成一个service什么的。
第一次玩github不知道这样询问是否合适,希望有人能拯救我。

刚开始能正常使用,后来出现 dial IP:PORT, i/o timeout

[E1214/143401.204:client.go(409)] invalid SOCKS version (SOCKS5 only)
... 2 similar message(s)
[E1214/143405.066:client.go(184)] dial IP:PORT, i/o timeout
[E1214/143405.148:client.go(409)] invalid SOCKS version (SOCKS5 only)
[E1214/143405.468:client.go(184)] dial IP:PORT, i/o timeout
[E1214/143405.582:client.go(409)] invalid SOCKS version (SOCKS5 only)
[E1214/143408.501:client.go(184)] dial IP:PORT, i/o timeout
[E1214/143408.539:client.go(409)] invalid SOCKS version (SOCKS5 only)
[E1214/143410.163:client.go(184)] dial IP:PORT, i/o timeout
[E1214/143410.244:client.go(409)] invalid SOCKS version (SOCKS5 only)
[E1214/143418.368:client.go(184)] dial IP:PORT, i/o timeout
[E1214/143418.401:client.go(409)] invalid SOCKS version (SOCKS5 only)
[E1214/143420.720:client.go(184)] dial IP:PORT, i/o timeout

重启过客户端了,没有效果

能修改Android客户端支持Cloudflare吗?

当前版本如果在服务器名称那里填写cf://example.com,会提示无法连接,显示服务器名称错误。请问楼主能改一下Android客户端让其支持Cloudflare吗?谢谢!

提一个建议:建议把 国内域名白名单 改成 国内IP白名单,更准确和省力

我今天在我博客写了个 GoFlyway的教程,其中一个使用者留言给我了一个建议,我转述并解释:

IP白名单相比域名白名单的优点:

  1. 国内IP段一般不会变动较大(例如 国内IP广播为国外IP,国外IP广播为国内IP),这就意味着维护成本低,而且有现成的网站提供较准确的国内IP段。
  2. 国内域名白名单变动太频繁,可以说每天都有大量的国内网站域名建立或关闭,所以域名白名单准确性有限(维护成本也高),或者说只能针对国内常见域名做白名单。

这样对比看,国内IP白名单 使用起来效果更好,所以建议在作者力所能及的情况下,更换 国内域名白名单 为 国内IP白名单 🤣

udp转发打不开

服务器端使用参数./goflyway -k=KEY -l=":80" -u 80,无法启动,显示
flag provided but not defined: -u

web管理默认的端口8101不可以更改

看了一下教程,没有提到可以改web管理端口的参数,但是如果windows里面不同配置开多个进程的话,默认的web管理都是8101端口,这样就只能开1个了,请问有什么解决办法吗?

无法使用IPv4连接

下载最新版本,在服务器上启动 goflyway

root@vps:~/goflyway# git log -1
commit 745a86d00a75d7e94d45409f87ff9e10c92cce07
Author: coyove <[email protected]>
Date:   Wed Sep 13 15:34:17 2017 +0800

    Directories cleanup
root@vps:~/goflyway# go run main.go -k=mykey -debug
     __//                   __ _                           
    /.__.\                 / _| |                          
    \ \/ /      __ _  ___ | |_| |_   ___      ____ _ _   _ 
 '__/    \     / _' |/ _ \|  _| | | | \ \ /\ / / _' | | | |
  \-      )   | (_| | (_) | | | | |_| |\ V  V / (_| | |_| |
   \_____/     \__, |\___/|_| |_|\__, | \_/\_/ \__,_|\__, |
 ____|_|____    __/ |             __/ |               __/ |
     " "  cf   |___/             |___/               |___/ 
 
[  0913 20:42:16.480] debug mode on, port 8100 for http proxy, port 8101 for socks5 proxy
[  0913 20:42:16.480] listening on :8102
[  0913 20:42:16.480] socks5 proxy at :8101
[  0913 20:42:16.480] http proxy at :8100, upstream is 127.0.0.1:8102

发现监听端口只有 tcp6 的,没有 IPv4

root@vps:~# netstat -nlp | grep main
tcp6       0      0 :::8100                 :::*                    LISTEN      3495/main       
tcp6       0      0 :::8101                 :::*                    LISTEN      3495/main       
tcp6       0      0 :::8102                 :::*                    LISTEN      3495/main       

支持SOCKS5的版本还没发布吧

如题,我记得1.0刚发布,我就下载使用了。
第二天看到说明更新,源码更新了,但是release版本好像还没更新吧,容易造成大家误解哦

failed to read ACL config err:open chinalist.txt:the system can not find the file specified

现象:windows端同时开2个goflyway进程,连接相同的服务器IP和端口,一个进程为全局,另一个进程指定本地ACL规则文件,都可以正常使用,是不是goflyway windows客户并不支持多个进程这种使用方式呢?io错误是不是本地IP到VPS IP之间丢包造成的?

进程1-全局错误:
failed to read ACL config (并未指定ACL文件,见后面的进程1配置)
err:open chinalist.txt:the system can not find the file specified
i/o timeout

进程2-ACL错误:
i/o timeout

环境:windows 10 pro 1709 16299 X64
浏览器:Chrome X64
服务端:v1.1.0 alpha
客户端:v1.1.0 alpha
客户端进程1:CreateObject("WScript.Shell").Run "P:\GoFlyWayBWG\goflyway.exe -g -k=pw -up=myip:1300 -l=:8200 -web-port=8201",0
客户端进程2:CreateObject("WScript.Shell").Run "P:\GoFlyWayBWG\goflyway.exe -k=pw -up=myip:1300 -l=:8300 -web-port=8301 -acl P:\GoFlyWayBWG\nobanAD.acl",0

default

acl

最新版本是否支持cloudflare?

域名已经通过cf加速,也使用了指定的cf端口,但是无法连接,客户端没有任何提示。
看到之前关闭的issue说不支持cf,但是教程里面却有cf模式,有点困惑。

你好棒棒哟

snipaste_20170823_235954

速度不错哦,虽然比不上v2ray,有没有技术细节啥的( ゚ 3゚)

LKL BBR SSR Config can't compatibility GoFlyway

LD_PRELOAD=/root/lkl/liblkl-hijack.so LKL_HIJACK_NET_QDISC="root|fq1" LKL_HIJACK_SYSCTL="net.ipv4.tcp_congestion_control=bbr;net.ipv4.tcp_wmem=4096 16384 30000000" LKL_HIJACK_OFFLOAD="0x9983" LKL_HIJACK_NET_IFTYPE=tap LKL_HIJACK_NET_IFPARAMS=lkl-tap LKL_HIJACK_NET_IP=10.0.0.2 LKL_HIJACK_NET_NETMASK_LEN=24 LKL_HIJACK_NET_GATEWAY=10.0.0.1 ./goflyway -k=12345 -l=12345 > GoFlyWay.log &

Same config SSR has been working but above config could't.

翻不了墙啊

hi.

root@gcv:# lsof -i:8100
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
goflyway 18202 root 3u IPv6 28152319 0t0 TCP *:8100 (LISTEN)
root@gcv:
#
可见服务器端运行正常。

本地机器:
yudeMacBook-Air:downloads brite$ ./goflyway -up=my-vps-ip:8100 -k=my-key
// __ _
/.
.\ / | |
\ / / __ _ ___ | |
| |_ ___ ____ _ _ _
'/ \ / ' |/ _ | | | | | \ \ /\ / / ' | | | |
- ) | (
| | (
) | | | | |
| |\ V V / (| | || |
____/ _, |_
/|| ||_, | _/_/ _,|_, |
||_ / | / | / |
" " cf |
/ |
/ |___/

[ 0930 10:12:53.071] listening on :8100, upstream is my-vps-ip:8100

怎么翻不了墙啊?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.