Top Related Projects
Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
An unidentifiable mechanism that helps you bypass GFW.
Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
A Rust port of shadowsocks
Make a fortune quietly
Quick Overview
V2Ray-core is a platform for building proxies to bypass network restrictions. It's designed to be a flexible and extensible toolkit for developing custom proxy solutions, supporting various protocols and transport methods. The project aims to provide a secure and efficient way to route network traffic.
Pros
- Highly customizable and extensible architecture
- Supports multiple protocols and transport methods
- Strong focus on security and privacy
- Active development and community support
Cons
- Steep learning curve for beginners
- Complex configuration process
- Limited official documentation in English
- May require additional tools or frontends for easier management
Code Examples
- Basic client configuration:
{
"inbounds": [{
"port": 1080,
"protocol": "socks",
"settings": {
"auth": "noauth"
}
}],
"outbounds": [{
"protocol": "vmess",
"settings": {
"vnext": [{
"address": "server.com",
"port": 10086,
"users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
}]
}
}]
}
This example shows a basic client configuration using SOCKS5 as the inbound protocol and VMess as the outbound protocol.
- Multi-protocol server configuration:
{
"inbounds": [
{
"port": 10086,
"protocol": "vmess",
"settings": {
"clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
}
},
{
"port": 10087,
"protocol": "shadowsocks",
"settings": {
"method": "aes-256-gcm",
"password": "password123"
}
}
],
"outbounds": [{
"protocol": "freedom"
}]
}
This example demonstrates a server configuration supporting both VMess and Shadowsocks protocols.
- Routing configuration:
{
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "direct"
},
{
"type": "field",
"domain": ["geosite:category-ads"],
"outboundTag": "block"
}
]
}
}
This routing configuration example shows how to route traffic based on IP addresses and domains, directing private IPs to a direct connection and blocking ad-related domains.
Getting Started
- Download the latest release from the official GitHub repository.
- Extract the archive and locate the
v2ray
executable. - Create a configuration file named
config.json
in the same directory as the executable. - Use one of the example configurations provided above or create your own.
- Run V2Ray using the following command:
./v2ray run -c config.json
- Configure your applications or system to use the proxy (e.g., SOCKS5 on localhost:1080 for the first example).
For more detailed instructions and advanced configurations, refer to the official documentation.
Competitor Comparisons
Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
Pros of Xray-core
- Implements XTLS protocol for improved performance and reduced overhead
- Offers more advanced routing capabilities and fine-grained control
- Includes additional features like VLESS protocol and reality protocol
Cons of Xray-core
- May have a steeper learning curve due to additional features and configurations
- Potentially less stable than v2ray-core as it's a newer fork with more frequent updates
Code Comparison
v2ray-core:
type ServerConfig struct {
Address *Address `json:"address"`
Port uint16 `json:"port"`
Network *Network `json:"network"`
}
Xray-core:
type ServerConfig struct {
Address *Address `json:"address"`
Port uint16 `json:"port"`
Network *Network `json:"network"`
Flow string `json:"flow"`
}
The main difference in the code example is the addition of the Flow
field in Xray-core's ServerConfig
struct, which is used for XTLS flow control settings.
Both projects are based on the original v2ray-core, with Xray-core being a fork that introduces new features and optimizations. While Xray-core offers enhanced performance and additional protocols, v2ray-core may be preferred for its stability and simpler configuration.
An unidentifiable mechanism that helps you bypass GFW.
Pros of Trojan
- Simpler and more lightweight design, focusing on a single protocol
- Potentially faster performance due to its streamlined approach
- Easier to set up and configure for basic use cases
Cons of Trojan
- Less versatile compared to V2Ray's multi-protocol support
- Fewer advanced features and customization options
- Smaller community and ecosystem
Code Comparison
Trojan (main.cpp):
int main(int argc, const char *argv[]) {
try {
Config config;
Service service(config);
return service.run();
} catch (const std::exception &e) {
Log::log_with_date_time(std::string("fatal: ") + e.what(), Log::FATAL);
return 1;
}
}
V2Ray (main.go):
func main() {
os.Setenv("v2ray.location.asset", env.GetAssetLocation())
core.PrintVersion()
configFiles := getConfigFilePath()
server, err := startV2Ray(configFiles)
if err != nil {
fmt.Println("Failed to start", err)
os.Exit(-1)
}
defer server.Close()
// ...
}
The code comparison shows that Trojan has a more compact main function, reflecting its simpler design, while V2Ray's main function includes more setup steps and error handling, indicating its more complex and feature-rich nature.
Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
Pros of trojan-go
- Simpler and more lightweight, focusing specifically on the Trojan protocol
- Potentially faster performance due to its specialized nature
- Easier to configure and deploy for users primarily interested in Trojan
Cons of trojan-go
- Less versatile compared to v2ray-core's multi-protocol support
- Smaller community and potentially slower development cycle
- May lack some advanced features available in v2ray-core
Code Comparison
v2ray-core (Go):
type Server struct {
config *Config
serverWorkers []*ServerWorker
}
func (s *Server) Start() error {
// Server initialization logic
}
trojan-go (Go):
type Server struct {
config *Config
auth auth.Authenticator
}
func (s *Server) Run() error {
// Server run logic
}
Both projects use Go and have similar structure for their server implementations. However, v2ray-core's codebase is more extensive due to its multi-protocol support, while trojan-go focuses specifically on the Trojan protocol, resulting in a more streamlined codebase.
v2ray-core offers a more comprehensive solution for various proxy needs, while trojan-go provides a specialized implementation of the Trojan protocol. The choice between them depends on the user's specific requirements and preferences for simplicity versus versatility.
A Rust port of shadowsocks
Pros of shadowsocks-rust
- Written in Rust, offering better memory safety and performance
- Lightweight and focused solely on the Shadowsocks protocol
- Easier to set up and configure for basic use cases
Cons of shadowsocks-rust
- Limited protocol support compared to v2ray-core
- Fewer advanced features and customization options
- Smaller community and ecosystem
Code Comparison
v2ray-core (Go):
type User struct {
Level uint32
Email string
}
type Account struct {
Id string
AlterId uint32
}
shadowsocks-rust (Rust):
pub struct ServerConfig {
pub addr: ServerAddr,
pub password: String,
pub method: CipherKind,
pub timeout: Option<Duration>,
}
The code snippets show differences in language syntax and structure. v2ray-core's code demonstrates its multi-protocol support with separate User and Account structs, while shadowsocks-rust's ServerConfig struct focuses on the essential Shadowsocks protocol configuration.
Both projects aim to provide secure and efficient proxy solutions, but v2ray-core offers more versatility and features at the cost of complexity, while shadowsocks-rust provides a streamlined, performance-focused implementation of the Shadowsocks protocol.
Make a fortune quietly
Pros of naiveproxy
- Simpler setup and configuration process
- Better performance in high-latency environments
- More resistant to detection and blocking
Cons of naiveproxy
- Less flexible with fewer protocol options
- Smaller community and ecosystem compared to v2ray-core
- Limited documentation and user guides
Code Comparison
v2ray-core:
type User struct {
Level uint32
Email string
}
type Account struct {
Id string
AlterId uint32
}
naiveproxy:
struct ProxyConfig {
std::string listen;
std::string proxy;
std::string padding;
std::string host;
};
The code snippets show different approaches to configuration. v2ray-core uses separate structs for user and account information, while naiveproxy combines configuration options into a single struct. This reflects the simpler setup of naiveproxy compared to the more complex and flexible v2ray-core.
Both projects aim to provide secure and efficient proxy solutions, but they cater to different use cases and preferences. v2ray-core offers more customization options and protocols, while naiveproxy focuses on simplicity and performance in challenging network conditions.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Project V
Project V is a set of network tools that helps you to build your own computer network. It secures your network connections and thus protects your privacy.
Related Links
- Documentation and Newcomer's Instructions
- Welcome to translate V2Ray documents via Transifex
Packaging Status
If you are willing to package V2Ray for other distros/platforms, please let us know or seek for help via GitHub issues.
License
Credits
This repo relies on the following third-party projects:
-
In production:
-
For testing only:
Top Related Projects
Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
An unidentifiable mechanism that helps you bypass GFW.
Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
A Rust port of shadowsocks
Make a fortune quietly
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot