Protocol & Core Reference

V2Ray Protocol Guide

Check the server settings first, then choose a protocol and core. This reference explains the roles, compatibility limits and trade-offs of VMess, VLESS, Trojan, Shadowsocks and REALITY. For your first setup, follow the user guide to import a profile, configure the proxy and verify the connection. Return to the relevant section when you need to check specific settings.

01 Configuration layers: What makes up a connection

The client interface is not the protocol

Start by distinguishing the graphical client, proxy core and remote server. v2rayN manages subscriptions, organizes profiles, selects outbound routes and controls the core through its interface; the core handles the actual connections. On Android, v2rayNG and v2flyNG also use the system VPN interface to capture app traffic. A “started” status means only that the relevant process or interface is running. It does not confirm successful authentication with the remote server or prove that all apps are using the proxy as intended.

A typical request passes through a local entry point, a routing decision, a remote outbound connection and the destination service. The browser sends the request to a local HTTP or SOCKS entry point. The core applies its rules to choose a direct connection or a proxy outbound, then communicates with the remote server using the configured protocol. On Android, traffic may enter through a virtual network interface, but routing and outbound processing still follow. When troubleshooting, first identify which layer received the traffic. Otherwise, a browser that is not using the system proxy can be mistaken for a VLESS configuration issue.

Check the protocol, transport and security layer separately

A proxy protocol defines authentication, how the destination is specified and how data is encapsulated—for example, VMess, VLESS, Trojan or Shadowsocks. A transport defines how that data is carried, such as over raw TCP, WebSocket or gRPC. The security layer protects the connection and verifies the peer; common options include TLS, while some Xray configurations use REALITY. Clients may show these as separate fields, but that does not mean every combination is valid. The server must provide a combination supported by the core in use.

The address and port locate the remote entry point. A user ID or password authenticates the protocol, while the server name is usually involved in TLS identity verification. WebSocket paths, the request Host and gRPC service names are transport settings. Several fields may happen to use the same domain, but they still serve different purposes. Changing the connection address to an IP does not mean the server name should also become that IP. Whether the connection will work depends on the certificate, server setup and configuration requirements—not just the field labels.

LayerTypical fieldsWhat to check
Remote entry pointAddress, portDoes it reach the right service?
Proxy protocolProtocol, authentication credentialsDo both sides use the same authentication method?
TransportTransport type, path, service nameDoes it match the remote listener?
Security layerTLS, server name, REALITY settingsDo the identity verification requirements match?
Local policyEntry point, routing, DNSIs app traffic routed as intended?

Use the layers to narrow down the problem

If the subscription imports but an error appears before the core starts, first check whether the core recognizes the configuration fields. If the core starts but the connection is immediately refused, check the remote address and listening port. For certificate name or handshake errors, check the security layer. If the connection is established but only some sites fail, look at routing, DNS and the destination service. The same “unable to connect” message can point to different layers, so the first specific error in the logs is more useful than the overall status shown in the interface.

Change one related group of fields at a time, and keep the original subscription details. Record the protocol, transport, security layer, address and authentication method before comparing settings. This helps avoid turning several changes into one new problem. If the subscription does not include all the necessary fields, get the complete connection details instead of guessing defaults from the protocol name. For the import steps, see the user guide. Layer-by-layer checks are useful when the import succeeds but the connection still fails; they address a different stage of setup.

02 Proxy protocols: Background and trade-offs

VMess: Authentication and data protection built in

VMess developed alongside the Project V ecosystem, with a focus that includes authenticated and protected proxy communications. It uses a user ID and involves time-based authentication conditions, so a system clock that is out of sync can cause authentication failures. Compatibility fields and legacy authentication methods found in older guides should not be applied blindly to current configurations. For an existing VMess service, start with the provider's complete subscription and check the core logs. Selecting VMess in a protocol menu alone will not fill in the authentication details required by the server.

VMess data protection and outer TLS operate at different layers. Enabling one does not mean the other fields can be filled in arbitrarily; whether to use TLS depends on the server setup. VMess can suit an existing service with a clearly specified configuration and an established subscription workflow. But the protocol's long history does not mean every client field is compatible. When migrating an older configuration, check whether the core accepts its authentication method. Seeing a profile in the client is not proof that it works.

VLESS: A leaner protocol that relies on a matching security layer

VLESS is designed to handle less within the protocol itself, separating authentication and proxy request details from connection protection. In common setups, it relies on an accompanying option such as TLS or REALITY to protect the connection. “Lean” does not guarantee better speed in every situation; it describes a division of responsibilities. With a VLESS server, check the security layer, transport and any configured flow together. Copying only the user ID does not make the configuration complete.

A flow is a specific flow-control mode, not a general performance setting. If the server requires one, the client, core and transport combination must all support it; adding one when the server does not require it can also cause failures. Some VLESS fields may look incidental, such as the server name and REALITY public key, but they affect the handshake. Compare complete configurations—VLESS with a specific security layer and transport—not VLESS connections as if they all had the same performance.

Trojan and Shadowsocks: Different authentication approaches

Trojan organizes proxy traffic over a TLS connection. Common configurations use password authentication and require the certificate to be verified correctly. The interface may show fewer fields than some other combinations, but that does not mean deployment involves fewer steps. The certificate name, server entry point, client clock and TLS settings still need to match. If a handshake fails, determine whether the error occurred during TLS or protocol authentication. Repeatedly changing the password will not fix a certificate name mismatch, and disabling certificate verification is not a sound long-term solution.

Shadowsocks was originally designed as a lightweight encrypted proxy and is often abbreviated to SS. Common AEAD methods and newer AEAD-2022 methods differ in key format and implementation support, so the client must support the method specified by the server. Unlike a typical Trojan connection, Shadowsocks does not use a TLS certificate as its basic authentication requirement, but the encryption method and key must still be correct. Do not assume any password will work with every method or that methods are interchangeable just because their names both include AES.

All four protocols can appear as profiles in a graphical client, but UDP support, transport combinations and import fields depend on the actual implementation. A capability supported by a protocol standard is not necessarily exposed in a particular client's current interface. Changing VMess to VLESS or Trojan to Shadowsocks is a configuration migration for both sides, not a local client optimization. Get a service that supports the new protocol first, then create and test a new profile. Keep the original for rollback rather than overwriting the only working configuration.

03 TLS & REALITY: Identity verification boundaries

TLS verifies more than whether the connection is encrypted

One important role of TLS is verifying the identity of the peer. Standard certificate validation checks the trust chain, validity period and whether the server name matches. A client can connect to an IP while using a specified domain as the server name for verification. The two values do not have to be textually identical, but they must match the server setup. The server name may appear in the interface as SNI or serverName. Check how the client and core use the field rather than treating it as a node label.

The WebSocket Host and the TLS server name are not the same setting. Host helps select the HTTP request's destination, while the server name is used in the TLS handshake and certificate verification. Depending on the setup, they may use the same domain or different values. ALPN negotiates the application-layer protocol, and some transports depend on the negotiation result. Copying an ALPN list from an old guide can disrupt automatic negotiation that was working correctly. Unless there is a specific requirement, do not fill in values just to “optimize” the connection.

REALITY requires a matching set of parameters

REALITY is a security layer in the Xray ecosystem and is commonly used with VLESS. Client settings typically include the server name, server public key, shortId and, depending on the implementation, a handshake fingerprint. The public key must match the actual server, and the server must accept the shortId; having the fields present does not mean their values are correct. REALITY follows a different setup from standard TLS certificates. Switching a regular TLS profile to REALITY and reusing all the other settings will not necessarily establish a connection.

The public key and user ID serve different purposes and cannot replace one another. A subscription carrying the server's public key is a normal way to pass connection settings, but the server's private key must never be put in the client configuration. The shortId is neither the remote port nor a free-form label. Different clients may display the same setting under different names, so compare what the field means. If a setting disappears after import, check the importer and core support rather than substituting a similar-looking field.

ParameterMain roleCommon mistake
Server nameUsed in the handshake and identity checksUsing the node label
Server public keyMatches the REALITY server identity settingsEntering the user ID by mistake
shortIdMatches an ID accepted by the serverGenerating one and changing only the client
Handshake fingerprintSelects handshake characteristics supported by the implementationSwitching it repeatedly as if it were a speed setting

Use evidence to troubleshoot verification failures

For an expired certificate warning on a standard TLS connection, check the device clock first, then confirm the server certificate's status. For a name mismatch, compare the server name with the domains covered by the certificate. A failed REALITY handshake calls for checking the public key, shortId, server name and combinations supported on both sides. Logs may not reveal every remote-side cause, so keep the full error context—but remove user IDs, subscription URLs and passwords before sharing it. Do not publish the full configuration just to get more detailed help.

Skipping certificate verification changes the trust boundary. Even if it allows a connection, it does not prove the original configuration was correct. The right fix is to correct the certificate chain, system time or server name. If the server uses a specific trust arrangement, get clear instructions and configure it using an option supported by the client. REALITY likewise cannot be fixed by “trying another fingerprint” instead of checking the parameters. Security settings determine whether a connection can be established; they are not decorative options to guess at, and identity material should never be copied from an unknown source.

Which combinations of transport, security layer and flow are valid depends on the implementation; not every arrangement of the interface's dropdowns will work. Confirm the complete server configuration, check core support, then make sure the client preserves every field. This separates configuration errors from unsupported features and fields lost during import. For cases where the core rejects a configuration at startup, see How to diagnose core startup failures from the logs.

04 Connection speed and resource use: How to compare fairly

First-request latency and sustained throughput are different metrics

Separate the time it takes to establish a connection from throughput after it is established. When opening a small webpage, DNS resolution, round-trip latency, handshake count and server response time are often more noticeable than encryption throughput. For a large download, bandwidth, packet loss, congestion control and processing capacity are more likely to be bottlenecks. So “this protocol loads webpages faster” does not mean it will also download large files faster. A client's connectivity test usually covers a specific request path; it is not the same as the full experience of a real app.

Comparing protocols on different servers usually measures differences in network paths and load. A fairer comparison keeps the remote location, machine resources, destination, local network and test time as similar as possible, changing only the configuration factor under test. Even then, short-term results can be affected by caching, connection reuse and background traffic. Do not change every subscription based on a single test. Repeat the test on the same device, record the conditions and decide whether the difference is consistent.

Encapsulation adds overhead, but it is not the only variable

Raw TCP transport generally adds less application-protocol encapsulation, while WebSocket and gRPC add their own handshakes and framing, along with ways to integrate with existing server infrastructure. Additional encapsulation can increase complexity, but fewer layers do not by themselves guarantee better real-world speed. Server implementation, connection reuse, proxy chains and intermediate devices can all affect the result. A transport that performs better on one network may not have an advantage on another.

Encryption uses processing resources, but actual costs also depend on processor acceleration, algorithm implementation and data-copying methods. Some methods are more likely to hit processing limits on low-power devices, while on a typical desktop the network may become the bottleneck first. VMess, Trojan and Shadowsocks overhead cannot be discussed apart from the specific method and outer protection. VLESS's lean design does not eliminate encryption costs across the whole connection, because its accompanying security layer still has work to do.

Evaluate connection reuse, UDP and memory separately

Connection reuse can reduce the cost of repeatedly establishing short-lived connections, but it can also make multiple requests share congestion or failures on the same underlying connection. Reuse mechanisms and their scope vary by core, and the server must support them too. When a configuration uses a specific flow or transport, do not casually add another reuse option. Evaluate first-page load time, concurrent tasks and recovery of long-lived connections—not just a single download progress bar. If the default is stable, there is no need to add variables just to chase a lower number.

Whether UDP works depends on the local traffic-capture method, routing, protocol implementation and server capabilities. Enabling UDP in the client only permits related processing; it does not give the remote server forwarding capability. For issues with real-time communications, first confirm that the app's traffic reaches the client, then check for protocol or transport limitations. DNS may also use UDP, but a DNS issue is not the same as a general UDP issue. Check the resolution path and the destination app's data path separately.

There is no fixed protocol ranking for memory use either. Connection count, buffers, DNS cache, rule sets, log volume and the graphical interface can all affect process memory. Distinguish the client interface process from the core, and compare them under similar workloads. A small difference in idle memory does not prove lower resource use over time. For slow speeds, follow the three-layer check for nodes, network paths and local settings; it is usually more useful than switching protocols at random.

05 V2Fly and Xray: Project relationships and compatibility

A shared background does not make them identical

Project V is a starting point for understanding this ecosystem, and V2Ray is its best-known proxy tool. V2Fly continues the development of related projects, while Xray has followed its own path of feature development within the same broader technical background. Both handle tasks such as proxying and routing and share many concepts, but they are not simply different names for the same binary. When choosing a core, focus on whether it supports the protocols, transports and security layers your configuration requires—not on which project name seems more familiar.

For the features covered here, REALITY and specific VLESS flows should be checked against Xray configuration; do not assume they will work unchanged in V2Fly. Even when both cores support a protocol, they may differ in field names, support scope, defaults and configuration validation. A configuration that parses has only passed syntax and partial field checks. To confirm the migration meets its original goals, also test the connection, verify routing and review the logs.

Graphical clients transform configurations

v2rayN is a suitable starting point for desktop use and managing subscriptions, and for checking which core is actually running. Available features depend on the installed package, client options and core logs; the product name is not a feature list. On Android, v2rayNG follows the Xray route, while v2flyNG is an alternative for the V2Fly route. They can import some of the same share links, but may save settings differently and generate different underlying configurations. Exporting between clients does not guarantee that every extended parameter will be preserved.

Many graphical clients do not run the raw subscription content directly. They first parse each profile, then generate a core configuration using local entry points, DNS, routing and interface settings. That makes successful import, complete fields in the interface and a correct core configuration three separate checks. Custom configuration mode may also use a different generation path from regular profiles. Before switching modes, identify which settings remain controlled by the interface and which are now managed by the custom file. Otherwise, interface changes may not affect every outbound connection.

Where you configure itCheck firstMigration notes
v2rayN desktopSelected core and the core actually launchedKeep backups of client settings and rules
v2rayNGXray support for the required combinationCheck the imported flow and security layer
v2flyNGV2Fly support for the required protocolDo not assume Xray-specific extensions work
Custom configurationConfiguration structure and the core actually runningDistinguish interface settings from file settings

Run a minimal test before changing cores

Before migrating, duplicate one profile rather than overwriting the entire configuration library. Record the original protocol, transport, security layer, flow, DNS and routing mode, then build an equivalent configuration in the candidate core. After startup, check for unrecognized fields or unsupported features in the logs, then test a simple request. If that works, verify any required UDP, rule-based routing and long-lived connections. This order helps distinguish a core that will not start from different behavior after startup, and reduces the number of issues to troubleshoot at once.

Updating the client and updating the core are not the same operation. A client update may improve link parsing and interface behavior; a core update may change protocol support or configuration validation. The two may depend on each other. There is no need to keep switching cores for a feature you do not use. If a regression appears, compare the actual configurations and logs before and after the update rather than just interface screenshots. For installation packages, visit the client downloads page. For Linux desktop setup, see deb/rpm installation and autostart.

06 Mobile battery use: Factors beyond the protocol

Power use comes from the entire processing chain

On Android, battery use cannot be predicted from the protocol name alone. v2rayNG and v2flyNG typically use the system VPN interface to capture traffic, then handle parsing, routing, encryption and forwarding. Background app requests, wireless network state, signal quality and device sleep policies all affect total power use. During sustained transfers, encryption and data copying matter more; at idle, frequent wake-ups and reconnects may matter more. Battery use for the same protocol is not directly comparable across different phones.

Wireless connections have their own active and power-saving states. Frequent small requests, periodic probes and very short keepalive intervals can prevent a device from entering deeper sleep. Intervals that are too long may let connections time out on some networks, causing reconnects. The right balance depends on mobile or Wi-Fi networks and intermediate devices; there is no fixed interval that works for every phone. If the defaults are stable, observe their behavior first. Do not copy a supposed battery-saving setup while changing probes, keepalives and system background restrictions all at once.

Evaluate keepalives alongside background restrictions

System battery optimization can restrict a client running in the background. If restrictions are too aggressive, the connection may drop when the screen locks and reconnect repeatedly after unlocking, or the notification may remain while the service is temporarily unavailable. Allowing background operation may improve availability, but does not guarantee lower battery use; it only reduces the risk of the system stopping the client. Before changing settings, confirm whether the problem occurs only when the screen is locked, then check the app's battery restrictions. Avoid applying unrestricted background policies to every networked app, which can increase unnecessary activity.

A persistent client notification indicates VPN service status; the notification itself does not mean the client is using high power. Removing or hiding it will not reduce the data processed by the core. To assess battery use, consider system battery statistics, actual screen-on time and network tasks. Separate the cost of traffic forwarded by the client from traffic generated by other apps. If an app syncs a large amount of data through the VPN, the system may attribute some overhead to related network processing. One percentage alone cannot prove the protocol implementation is at fault.

Compare the same tasks, not idle impressions

When comparing two configurations, keep screen state, signal conditions, app tasks and observation periods similar, and let the device cool to roughly the same temperature first. Observe sustained use and screen-locked idle separately: the former reflects transfer and processing costs, while the latter can reveal background polling and reconnects. If battery use rises only after a network change, check recovery behavior and retry loops before switching encryption methods. High log verbosity also increases recording and storage activity; once troubleshooting is done, restore a suitable level for everyday use.

Routing and DNS can also affect battery use. Sending every request through a remote server, even those that could be reached directly, may increase traffic and processing. But overly complex rules and frequent remote lookups can add work too. Use rules that fit the actual requirements, and reduce duplicate lookups and failed retries rather than chasing a higher rule count. Keep traffic routing consistent: sending related connections from the same app along conflicting paths to avoid a few proxy requests can trigger repeated retries.

Choose a combination that has proven stable and whose fields the client fully supports. A lightweight protocol may reduce processing costs on some devices, but a configuration that triggers repeated handshakes, retries or app fallbacks can use more power overall. If you need REALITY, check the Xray route rather than assigning the same profile to an implementation that does not support it just to save power. For system settings, see v2rayNG background restrictions and battery settings, and keep the original settings for comparison.

07 Subscription formats: A successful import does not guarantee full compatibility

A subscription URL is different from a single share link

A subscription URL usually points to a refreshable collection of profiles, while a single share link describes one connection directly. Pasting a share link into a field that accepts only subscription URLs—or pasting a subscription webpage into a single-link importer—can fail. Subscription content may use a single Base64-encoded block, one URI per line or a client-specific format. Base64 is only an encoding; it does not add protocol compatibility or protect the content. Anyone with the decoded text may be able to recover the connection settings.

Share formats do not all express the same information. Common VMess links carry encoded structured fields. VLESS and Trojan links often use URI query parameters for transport and security options, while Shadowsocks links encode user information and specify the method. Conventions can also vary within the same protocol. An importer converts these representations into a client's internal fields, so one client reading a link does not mean another will interpret every extension in exactly the same way.

Check that the importer preserves key fields

After import, check the protocol, address, port, authentication details, transport and security layer. For VLESS, also check the flow; for REALITY, check the public key, shortId, server name and required handshake options. For WebSocket, check the path and Host; for gRPC, the service name. A label can change, but these connection fields should not disappear during conversion. If a profile works in the original client but fails after migration, compare the fields one by one rather than blaming network quality first.

A full core JSON configuration and a subscription of profiles are different kinds of input. A full configuration may include a local listener, routing, DNS and multiple outbounds, so replacing it can change far more than one remote connection. A regular share link generally does not include the complete local policy. Before importing an unknown configuration, check what it takes over and save your existing settings. The snippet below shows only a local SOCKS entry point. It contains no remote credentials and is not a complete configuration that can connect to a proxy on its own.

{
  "inbounds": [
    {
      "tag": "local-socks",
      "listen": "127.0.0.1",
      "port": 10808,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      }
    }
  ]
}

This entry point binds to the local loopback address, so it accepts connections only from the same device. Its port must match the value used by the app and must not already be in use by another process. It does not define a remote outbound and cannot replace a subscription. When sharing configurations, distinguish publishable structural examples from real connection details: subscription URLs, user IDs and passwords may grant access, so remove them from screenshots, logs and support requests. QR codes and encoded strings may contain full credentials too; do not share them just because they are hard to read.

Handle update failures separately from parsing failures

An update can fail before content is retrieved—for example, because the subscription URL is invalid, the connection times out or the server returns an error. It can also fail after retrieval if the response is actually a webpage, the format is unsupported or a profile field cannot be parsed. Check the update log and response type first, then decide whether to investigate the network or the format. If the client retrieved a login page, switching protocols repeatedly will not turn it into a usable subscription. Do not paste a full subscription URL into a public online conversion tool; that can expose credentials.

Updating a subscription may also overwrite local changes. If you manually corrected a field in a subscription profile, refreshing may restore the value supplied by the server. Check how the client saves and replaces settings first. To keep a local change long term, duplicate the profile as a separate entry after understanding how updates work, and note its source and purpose. See Subscription format comparison for v2rayN and v2rayNG for import details. If updates keep failing, use Troubleshooting to investigate by error type; do not start by deleting your entire configuration library.

08 Choosing for your use case: Put configuration checks into practice

Existing subscription: Compatibility comes before protocol preference

If you already have a subscription, choose a client and core that can fully represent its fields. On desktop, start with v2rayN and select the installation package for your system and architecture on the downloads page. On Android, check v2rayNG first if you need Xray support; if you already have a V2Fly-compatible configuration, consider v2flyNG. Import and verify the provider's settings as supplied before considering local optimizations. If the remote server provides only VMess, changing the client to VLESS will not make the corresponding service available; it will break authentication and data interpretation instead.

If your subscription contains profiles for multiple protocols, do not rule one out based on its name. First exclude combinations unsupported by the current core, then compare real tasks under similar network conditions. Everyday browsing, sustained transfers, real-time communications and recovery after screen lock call for different checks. For long-term use, stable connections, interpretable fields, useful logs and consistent behavior after updates are usually more important than being slightly faster in a single test. If nothing is broken, keeping a verified configuration avoids unnecessary maintenance.

Manual setup: Start with capabilities supported on both sides

When managing your own server, first list the protocols, transports and security layers supported by both sides, then consider the deployment environment. To integrate with existing HTTP infrastructure, you may need to assess the requirements of WebSocket or gRPC. For a specific REALITY combination, confirm Xray support on both ends and match the parameters. With Shadowsocks, check the method and key format first. Choose based on verifiable deployment needs, not the assumption that a “newer protocol” or “more settings” guarantees better performance.

Include maintenance effort in your decision. A standard TLS setup requires attention to certificate status and name matching; a REALITY setup requires managing the corresponding key material and allowed parameters. All setups require secure handling of authentication details. A familiar combination you can maintain is more practical than a complex configuration you cannot explain. For a migration, create a separate entry point or test profile. Verify it before replacing the old setup gradually, so changing the server and every client at once does not eliminate your working comparison path.

Use caseCheck firstVerify next
Complete subscription availableImported fields and core supportDo the settings remain correct after an update?
REALITY requiredXray support and handshake settingsDo the security layer, flow and transport match?
Long-term mobile useStability and background recoveryReconnects while idle and battery use during real tasks
Sustained high-volume transfersNetwork path, packet loss and processing limitsSustained transfer performance under the same conditions
Migration between clientsLink parsing and field preservationRouting, DNS and UDP behavior

Validate with a minimal test record

For each candidate configuration, record the protocol, transport, security layer, core, test task and result. There is no need to record complete credentials for public sharing. Run the first checks in order: can the core start, does the local entry point work, does the remote handshake complete, does the destination load, and is routing as expected? If a step fails, stop expanding the test and resolve the relevant log error first. This helps distinguish configuration problems from network fluctuations and makes it clear what changed if you need to roll back.

Acceptance testing should include edge cases. On desktop, check that the system proxy returns to the expected state after closing the client, and verify local ports and rules after restarting. On mobile, test screen lock, network changes and reconnection. After a subscription update, spot-check key fields; after a custom configuration change, check the startup logs. Opening one webpage in a browser is not enough to prove the whole workflow works. Reproducible steps are more useful for diagnosing issues than repeatedly reinstalling the client, and make it easier to retest after updates.

For installation and import steps, return to the Getting Started guide. To switch platforms or architectures, compare package types on the client downloads page. For a specific error, start with Troubleshooting and the relevant log guide. This page explains how configuration settings relate so you can make informed choices. Get the configuration right first, verify the connection path next, and compare speed and battery use last. This order applies across the protocols and client combinations covered here.