v2ray / v2ray-core Goto Github PK
View Code? Open in Web Editor NEWA platform for building proxies to bypass network restrictions.
Home Page: https://www.v2ray.com/
License: MIT License
A platform for building proxies to bypass network restrictions.
Home Page: https://www.v2ray.com/
License: MIT License
[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?
您好,非常感谢您的付出。请问您是否可以在Release中添加SHA1的哈希校验呢?谢谢您。
V2Ray should provide an interface to route traffic on demand.
时间随机数,它没法确保两台机子时间完全同步,如果加上网络延迟刚好差1s,那么这1s内就有1/30的数据包会丢失,而且我看了下这个协议的逻辑是十分占用CPU的。不过动态加密比ss好
提示版本不兼容。检查了一下,发现32位和64位的主程序好像是一个文件,是不是打包时弄错了?
sorry for my english
Building V2Ray (v0.10) for linux amd64
../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 }
使用如下命令安装的:
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
如果能把所有所有流量都用v2ray走就更好了。类Unix系统都支持TUNTAP。TUN是个虚拟的Interface,可以让程序获取IP包。
你们看有没有必要做这个支持?
我自己写过一个用TUN的简单VPN。需要的话可以来写。
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 秒内随机选择一个时间点,用于生成认证信息,这样使得每一个数据包的头部都不相同。
这样做的好处是:
坏处是:
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 的头部和客户端发来的首个数据包合并为一个数据包,以减小数据包的可识别性,实际效果还在研究中。
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.
After a second thought, I believe this is actually a necessary feature in favor of a remote SOCKS V2Ray Point server.
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%.
谢谢付出!千言万语,感激难尽!不会代码,技术上只能帮你应用端在墙内测试了!多见谅!
请问加密方式还是只支持AES128吗? 还是说目前有更多加密方式了
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.
To enable V2Ray for iOS and Android, we need IP level encryption, as Socks protocol is not supported natively in these platforms.
/common/collect/timed_queue.go
25行
queue[i],queue[j]= queue[j],queue[i]
希望有如下的实现建议:
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).
还在墙内的码农感谢你。
我在搬瓦工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位
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.
第一代翻墙工具:普通代理
第二代翻墙工具: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。这样以后即便自己服务暴露,审查人员也有相当大几率看不到。审查人员可以审查大众,大众也可以反向审查嘛。
请修正错别字
“减化” -> "简化"
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.
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.
I'm a general programmer in China Mainland.
I used both lantern (instable after 2.0.2) and 云梯 (responsive and responsible) .
In fact i also used 红杏 (really suck).
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
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
装上之后,查了一个晚上。才发现本地时间不对了。修改之后果然就工作了。希望在README里面说明一下这点,因为debug log非常不足。
Anything that is close to freedom, proxy, ray, anti-censorship are welcome.
经测试,在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
最新版v2ray在Server端不能用nohup加&运行,否则跟客户端无法连接。
如果直接在前台运行就正常,请帮忙看看到底什么问题,谢谢
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~
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.
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.
The following programs don't work well under V2Ray tunnel:
试用了几天,感觉不错,good job,thx. 有个小问题:
json 配置文件如果有注释(// ooxx)就会提示下面信息无法工作:
[Error]Failed to load VMess outbound config: invalid character '/' looking for beginning of object key string
(使用注释的原因是暂时没有服务器切换功能,想在 out_vmess.json 预留多个服务器信息)
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.
vps编译好了,怎么使用,PC上要怎么弄,小白求教程
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:
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 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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.