Giter VIP home page Giter VIP logo

v2ray-core's Introduction

v2ray-core's People

Contributors

actions-user avatar agioi avatar boypt avatar darhwa avatar darienraymond avatar dependabot[bot] avatar ducksoft avatar fcying avatar felixonmars avatar kallydev avatar keepalivesrc avatar kslr avatar loyalsoldier avatar lucifer9 avatar mzz2017 avatar nicholascw avatar rprx avatar sunshineplan avatar tnextday avatar toutyrater avatar unknowndevqwq avatar vcptr avatar victoriaraymond avatar vigilans avatar weaving118 avatar wuxiangzhou2010 avatar xiaokangwang avatar xymopen avatar yuhan6665 avatar yujinqiu 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

v2ray-core's Issues

We need a logo

Anything that is close to freedom, proxy, ray, anti-censorship are welcome.

感谢你们!

谢谢付出!千言万语,感激难尽!不会代码,技术上只能帮你应用端在墙内测试了!多见谅!

启动时报错 runtime error: invalid memory address or nil pointer dereference

OS: ubuntu server 14.04 64bit
v2Ray 版本: 不知道怎样取得版本可功能,2015/10/10 10:30AM左右执行 go get github.com/v2ray/v2ray-core 取的代码。应该最新的,在项目首页copy sha得到的:b115df56c08aff26b80c5e1eb8134a594d84670b
golang 版本:1.5.1
问题描述:把json文件复制到 GOPATH/bin/config,vpoint_vmess_freedom.json内容如下

"port": 27183,
"inbound": {
"protocol": "vmess",
"settings": {
"clients": [
{"id": "ec12cd1a-6e37-11e5-9d70-feff819cdc9f"}
],
"udp": false
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
}
}

执行./server --config="/root/work/bin/config/vpoint_vmess_freedom.json" 会报错,日志如下

root@xxxxxxxxx:~/work/bin# ./server --config="/root/work/bin/config/vpoint_vmess_freedom.json"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x47b9cf]

goroutine 1 [running]:
github.com/v2ray/v2ray-core/config/json.(*LogConfig).AccessLog(0x0, 0x5e3720, 0x780cd8)
/root/work/src/github.com/v2ray/v2ray-core/config/json/json.go:40 +0x1f
main.main()
/root/work/src/github.com/v2ray/v2ray-core/release/server/main.go:58 +0x76d

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 6 [chan receive]:
github.com/v2ray/v2ray-core/common/alloc.(*bufferPool).cleanup(0xc82000a1e0, 0xc820014240)
/root/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:94 +0x58
created by github.com/v2ray/v2ray-core/common/alloc.newBufferPool
/root/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:68 +0x153

goroutine 7 [chan receive]:
github.com/v2ray/v2ray-core/common/alloc.(*bufferPool).cleanup(0xc82000a220, 0xc820014300)
/root/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:94 +0x58
created by github.com/v2ray/v2ray-core/common/alloc.newBufferPool
/root/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:68 +0x153

goroutine 8 [chan receive]:
github.com/v2ray/v2ray-core/common/alloc.(*bufferPool).cleanup(0xc82000a260, 0xc8200143c0)
/root/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:94 +0x58
created by github.com/v2ray/v2ray-core/common/alloc.newBufferPool
/root/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:68 +0x153

运行时错误:invalid memory address or nil pointer dereference

使用如下命令安装的:
go get github.com/v2ray/v2ray-core
go build github.com/v2ray/v2ray-core/release/server

错误信息如下:
[ec2-user@ip ~]$ ./server --config="/home/ec2-user/vpoint_vmess_freedom.json"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x47b9cf]

goroutine 1 [running]:
github.com/v2ray/v2ray-core/config/json.(*LogConfig).AccessLog(0x0, 0x5e3720, 0x780cd8)
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/config/json/json.go:40 +0x1f
main.main()
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/release/server/main.go:58 +0x76d

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 6 [runnable]:
github.com/v2ray/v2ray-core/common/alloc.(*bufferPool).cleanup(0xc82000a2a0, 0xc82001a1e0)
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:93
created by github.com/v2ray/v2ray-core/common/alloc.newBufferPool
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:68 +0x153

goroutine 7 [runnable]:
github.com/v2ray/v2ray-core/common/alloc.(*bufferPool).cleanup(0xc82000a2e0, 0xc82001a2a0)
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:93
created by github.com/v2ray/v2ray-core/common/alloc.newBufferPool
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:68 +0x153

goroutine 8 [runnable]:
github.com/v2ray/v2ray-core/common/alloc.(*bufferPool).cleanup(0xc82000a320, 0xc82001a360)
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:93
created by github.com/v2ray/v2ray-core/common/alloc.newBufferPool
/home/ec2-user/work/src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:68 +0x153

Support transparent proxy

When a network packet is redirected through iptables, the original destination address is stored in socket option: SO_ORIGINAL_DST

A new inbound connection handler is needed for such scenario.

小问题

试用了几天,感觉不错,good job,thx. 有个小问题:

json 配置文件如果有注释(// ooxx)就会提示下面信息无法工作:
[Error]Failed to load VMess outbound config: invalid character '/' looking for beginning of object key string

(使用注释的原因是暂时没有服务器切换功能,想在 out_vmess.json 预留多个服务器信息)

内存溢出

我在搬瓦工ubuntu上搭了一个server
512mb内存已经吃了70%多了

mickey 28474 0.5 73.9 479760 387452 ? Sl 10月06 30:36 ./server --config=/home/mickey/work/src/github.com/v2ray/v2ray-core/release/config/vpoint_vmess_freedom.json

ubuntu14.04 server 64位

关于v2ray的协议

时间随机数,它没法确保两台机子时间完全同步,如果加上网络延迟刚好差1s,那么这1s内就有1/30的数据包会丢失,而且我看了下这个协议的逻辑是十分占用CPU的。不过动态加密比ss好

Socks UDP compatibility issues

The following programs don't work well under V2Ray tunnel:

  • Steam (over sockscap64)
  • Skype (native Socks support)
  • QQ (native Socks support)

Slow memory leak found on V2Ray official server

There is a very slow memory leak (~ 10M / day) observed on the official server. The server is running V2Ray 1.2 at the moment.

This bug is considered as low priority, as the leakage is very slow (100 bytes / second).

Able to run on openwrt

It would be great that V2Ray is able to run on a router so that the whole family surf the internet without blocking.

Current difficulties are:

  • golang doesn't have a compiler option for openwrt;
  • V2Ray still uses too much ram (~10M) which doesn't fit for a regular router.

希望你们下一代翻墙工具加强防御机制,反制措施

第一代翻墙工具:普通代理
第二代翻墙工具:SSH, VPN
第三代翻墙工具:ShadowSocks, GoAgent

纵观这些工具,输出攻击(翻墙能力)很强,但是弱点就是防御为0,基本不设防。有什么问题?GFW会主动探测并且封杀掉这些外边服务器IP。导致可用IP越来越少。

要设防,如何设防?最简单的功能,比如遇到异常流量,封IP。异常登录,封IP。虽然这些功能弱爆了,但是市面上还真没有那款服务器软件做到了。甚至密码爆破都不设防。这些服放在外面公网,这不等着被人踹门么。

其次,默认不开放服务,通过out-of-the-band手段才能打开服务。

服务器默认要拒绝任何IP的任何TCP连接。必须向 [email protected] 发送一封邮件,邮件内容是我需要上网的国内IP,gmail向服务器自动转发这个邮件,然后服务器才允许这个IP访问连接。(只是举例子,可以参考tor bridge的方法)

这种防御虽然简单,但是极大的麻烦了GFW研发人员的逆向和探测手段。当然,大家可以发散思维,加上各种变态的防御手段。提高GFW的攻击成本,就是提升自己的生存空间。

除了设防,第二个手段,还要反制。墙外的同学组织起来,建立蜜罐,去12377/12321/CERT举报,钓他们的鱼,他们一访问,就封杀他们的来源IP。这样以后即便自己服务暴露,审查人员也有相当大几率看不到。审查人员可以审查大众,大众也可以反向审查嘛。

关于Golang版本的问题

安装教程下载安装Google官方的1.5的golang包,但Ubuntu官方源提供一个1.2.1版本的golang编译器。

为什么不直接使用官方源提供的版本?1.2有功能缺失的?

syntax error: unexpected range

Building V2Ray (v0.10) for linux amd64

github.com/v2ray/v2ray-core/common/alloc

../src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:112: syntax error: unexpected range, expecting {
../src/github.com/v2ray/v2ray-core/common/alloc/buffer.go:125: syntax error: unexpected }

Type naming convention

Current codebase uses V prefix for almost anything, which doesn't use Golang's naming convention. The whole code should be put in v2ray package thus the types would be referred as v2ray.ID in other packages.

Centos6.6 Docker 运行错误

[root@docker ~]# ./server --config="/root/vpoint_vmess_freedom.json"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x47ac9b]

goroutine 1 [running]:
github.com/v2ray/v2ray-core/config/json.LoadConfig(0x7fff7058a8ae, 0x1f, 0x40cdcd, 0x0, 0x0)
/root/work/src/github.com/v2ray/v2ray-core/config/json/json.go:63 +0x82b
main.main()
/root/work/src/github.com/v2ray/v2ray-core/release/server/main.go:47 +0x4ff

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1
以上为错误日志。难道是不支持Docker?

We want donate and hope keep updating

I'm a general programmer in China Mainland.
I used both lantern (instable after 2.0.2) and 云梯 (responsive and responsible) .
qq20150914-2
In fact i also used 红杏 (really suck).
qq20150914-1
I'm not care about the money but the attitude! What a fu*king company?

I believe a lot of person need stable ladder like v2ray. So i appeal to donate v2ray and hope keep updating as far as possible.

What about this advice ?@v2ray

Enable IP level encryption

To enable V2Ray for iOS and Android, we need IP level encryption, as Socks protocol is not supported natively in these platforms.

No useful English repository description

Let's crack the wall. is not helpful. What wall? Is "crack" in physical or in informational sence?

The description should show the what is v2ray, the goal and scope of the project and so on.

The description is important because of this is the only big of information about the project (apart from used programming languages and project name) that is visible in search.

v2ray-core/spec/guide.md 配置文件中关于引用外部配置路径的描述,可能需要补充

经测试,在Windows 10下,vpoint_socks_vmess.json中inbound.file 以及 outbound.file的路径同样需要填写绝对路径。将这三个文件放在同一目录下,然后填写fileName./fileName 并没有作用,在运行server时报错:
[Error]Unable to read config file open out_vmess.json: The system cannot find the file specified.

改写为绝对路径后,一切正常。

测试环境:

PointA: Windows 10 x64, go version 1.5.1
PointB: Ubuntu 14.04.1 LTS x86, go version 1.5.1

一些建议

希望有如下的实现建议:

  1. 采用 peer to peer 的实现, 不需要有固定的服务器和客户端
  2. 中心的地址服务器采用 邮件或者是 不容易屏蔽的文件系统进行管理, 或者是网盘
  3. 地址互相复制的原则, 去中心化,自动多点备份地址
  4. 加密算法的实现,和平台无关, 为脚本或者是库自带的
  5. 管理工具使用网页,不需要开发客户端程序,启动之后自动打开浏览器管理页面
  6. 参考lantern的实现, 最好是做成脚本级别的,文件小,方便找

Support SOCKS proxy version 4

It seems that Windows doesn't not support SOCKS version 5 (for unknown reason). Verified on Windows 2012, both IE and Chrome send SOCKS4 request instead of SOCKS5.

Consider this as a release blocker for V1.0.

Code coverage over 50% before v1.0

golang really sucks in testing. There is no unit testing library, no mocks, no dependency injection. I am struggling to improve coverage rate to over 50%.

Support Connection: Keep-Alive in http proxy

For now we explicitly set "Connection: Close" when proxying requests in http proxy. All http requests will be tunnelled to V2Ray server in separate channels, which decrease performance. It would be great that related requests are grouped together, and sent through a Keep-Alive connection.

Zero config before launching V2Ray process

V2Ray should provide a UI for configuration, even for the first run. Ideally the UI is provided in the form of webpage for cross platform reasons (#24). V2Ray should be able to run with default config shipping with the binary, and users just use the UI to config it.

V2Ray 的认证和加密方式简介

V2Ray 默认使用自有的 VMess 协议。目前协议已趋于稳定,1.0 版本发布前,如没有重大缺陷,将不会再改。

VMess 协议包含两种数据格式,分别针对 TCP 和 UDP 的数据特点而设计。其中 TCP 的数据包在请求数据中加入了约 80 字节的头部,响应数据加入了 4 字节的头部;而 UDP 数据包则统一加入了约 40 字节的头部。TCP 的非对称设计主要是因为多数 TCP 数据包是 HTTP 通讯,而 HTTP 通讯的请求数据大小通常远小于响应数据,于是在请求数据中多加入一些额外的信息,不会对性能产生太大的影响。

认证方式

VMess 强制要求用户 ID 为一个 16 字节长的随机值,可由机器随机生成。在 VMess 的 TCP 请求数据包和 UDP 数据包中,起始的 16 字节均为认证信息。这个认证信息基于(用户 ID + 时间)生成,每一个认证信息在 1 分钟内有效(时间可以调节),类似当下流行的两步验证的验证码。在实际应用中,V2Ray 会在当前时间的前后 30 秒内随机选择一个时间点,用于生成认证信息,这样使得每一个数据包的头部都不相同。

这样做的好处是:

  • 一定程度上抵御流量重放攻击,攻击者必须不间断地截获有效的认证信息;
  • 高效的身份验证,服务器端不需要解密数据即可判断用户的有效性,可以抵御更高流量的 DoS 攻击;

坏处是:

  • 要求客户端和服务器的时间同步(误差在一分钟内),尽管有很多原因能导致机器时间不准,但我不认为这将会是一个严重的问题;

加密方式

VMess 主要使用两种加密/散列方式:AES-128-CFB 和 HMAC(MD5),在这两种方式被证明有缺陷之前,将不会引入更加复杂的加密方式。对于移动设备/路由器等计算资源薄弱的设备,将来会考虑引入轻量级的加密方式(如 chacha20)。目前高端的 CPU (Intel i5/i7,ARMv8-A 等)都已支持 AES-NI,轻量级加密方式的必要性还有待研究。

TCP 和 UDP 数据的认证信息使用 HMAC(MD5) 散列,不可被逆转。

TCP 请求的指令部分使用固定的 Key 和随机 IV 加密,数据部分使用随机 Key 和随机 IV 加密,TCP 响应也使用随机 Key 和随机 IV 加密;UDP 数据均采用固定的 Key 和随机 IV 加密。

具体的实现细节请参考 VMess 协议

数据包特征

基于散列和 IV 带来的随机性,VMess 数据包的内容可以被认为是完全随机的。至于数据包的长度,V2Ray 会把 VMess 的头部和客户端发来的首个数据包合并为一个数据包,以减小数据包的可识别性,实际效果还在研究中。

unexpected response header,The connection is probably hijacked.

I downloaded the 'v2ray-windows-64.zip' and replaced the ID in 'config.json', and I also set SwitchyOmega in the right way.
In the meantime, the ID had been added in the Server B, while when I opened the v2ray.exe,it told me 'unexpected response header,The connection is probably hijacked.'.
Could you tell me what's going on?
Thanks~

windows7 32位,0.6无法运行

提示版本不兼容。检查了一下,发现32位和64位的主程序好像是一个文件,是不是打包时弄错了?

Add support for Socks5 UDP Associate command

UDP Associate command (0x03) is used for DNS resolution (probably). Assuming it is not a required feature for browser to resolve IP address (as TCP Connect allows domain name as a parameter), I'd like to not rush it in V1.

About using proxifier, mstsc will disconnect within a few minutes

Envirment:
v2ray version:v0.91 OS:Windows8.1

Description:
It seems that it will disconnect within a few minutes(~30 minutes not yet).
The following error message will display many times before the connection lost.

Error message:
[Error]VMessOut: Failed to read VMess response (0 bytes): read tcp 192.168.1.2:9
388->{serverip:port}: wsarecv: A connection attempt failed because the connect
ed party did not properly respond after a period of time, or established connect
ion failed because connected host has failed to respond.

Add support for Socks5 TCP Bind command

Socks5 TCP Bind command (0x02) is used to bind a local port with certain connection, to allow remote server send data initiatively. This feature allows software like FTP client to work on passive mode.

This is not a first priority feature in V2Ray. If you are interested in implementing this, please send a PR.

Socks UDP doesn't work on remote host

For now in Socks replies, UDP address is 127.0.0.1:port, as the program is unable to know the actual IP address of the machine, in the case of the machine is behind some firewall. We need another flag in the config file to allow users to set the IP.

Support TUNTAP as inbound

如果能把所有所有流量都用v2ray走就更好了。类Unix系统都支持TUNTAP。TUN是个虚拟的Interface,可以让程序获取IP包。
你们看有没有必要做这个支持?
我自己写过一个用TUN的简单VPN。需要的话可以来写。

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.