Technical Reference · Protocol Selection

V2Ray Protocol Guide

From connection parameters to core implementations: which settings must match the server, and which differences are worth testing on your own devices.

Follow Getting Started to complete your first setup: import a profile, choose a mode, connect, and verify. This page is a technical reference explaining why the same configuration works in one client but fails to import in another, and how to compare latency, resource use, and battery life after connecting. Already have a configuration? Jump to the relevant section.

01 · Connection layers

VMess and VLESS: Understand protocols, transports, and security layers

What a connection profile contains

The “protocol” setting in a client doesn’t determine the connection by itself. A working profile needs at least the server address and port, the proxy protocol and credentials, the transport that carries requests, and any outer security mechanism. Some interfaces put all these fields on one screen, and may even translate two unrelated options as “encryption.” To identify a field, ask what it controls: identity verification, byte transport, or peer validation? Separate these roles, then compare them with the original profile. This helps prevent entering a security-layer setting in the protocol field.

For a domain-based connection, the server address determines where the client connects, while DNS resolution affects the resulting IP address. When TLS is enabled, the server name usually matters for the handshake and certificate validation. A WebSocket transport may also have its own request path and host field. These values may happen to match in some deployments, but they are not interchangeable. Resolving a domain successfully doesn’t mean its certificate will validate, and a successful handshake doesn’t confirm that the path is correct. Record results by layer when making changes; it’s easier to diagnose problems than by changing every domain-like value to the same thing.

VMess: an early design with authentication and data protection built into the protocol

VMess is one of the protocols designed early on for Project V’s proxy ecosystem. It uses a user identifier for authentication and provides protection for requests and data within the protocol, rather than leaving all security responsibilities to an outer layer. Later authentication methods and extra identifier fields in older profiles have historical roots, so don’t treat nonzero values in old documentation as speed settings. If an older profile includes such a field, first check which format the server and current core support. Keep the working profile and test the migration with a copy rather than replacing every entry at once.

Time is an easy-to-miss factor when troubleshooting VMess because its authentication checks involve the clock. If the same profile works on a computer but fails on a recently reset device, check whether automatic time synchronization is working. A different displayed time zone isn’t necessarily a problem; what matters is the accuracy of the system clock. If syncing the clock doesn’t help, check the port, credentials, transport, and outer handshake logs one by one. Don’t focus only on a final “connection closed” message: it may follow an earlier validation failure. The first relevant log entry before it is usually more informative.

VLESS: many protection responsibilities are handled by the configuration as a whole

VLESS was designed as a leaner proxy layer, separating identity from traffic protection and commonly relying on an outer security mechanism for protection. Newer implementations may also offer extensions, so a simple “yes” or “no” from an older interface doesn’t describe every version. In common configurations, none in the proxy-layer encryption field doesn’t, by itself, mean the entire connection is unencrypted; check the security-layer settings too. Conversely, switching only from VMess to VLESS won’t automatically add the right security protection to an existing connection.

A VLESS profile may also include flow. It specifies a particular flow-control scheme, not a service tier or a universal speed boost. If a previously working profile fails after being imported into another client, the importer may have kept the user ID but dropped the transport, security layer, or flow setting. The edit screen can look complete while the connection still fails. Compare the key fields before and after migration, then check whether the core supports that combination. If even one layer doesn’t match, changing the user ID or retrying won’t restore the missing capability.

LayerCommon fieldsWhat to check
PurposeAddress, portWhich service the client connects to; whether the address is still valid
Proxy protocolType, user ID or password, flow-control settingHow both ends identify requests and verify identity
TransportTransport type, path, service nameCheck the fields required by the selected transport; don’t fill them with settings for another transport
Security layerTLS, REALITY, and their validation fieldsEnter only the fields required by the selected mechanism and compare them with the server details
02 · Protocol trade-offs

Trojan and SS: Certificate-based security and pre-shared keys

Trojan: establish TLS before proxy authentication

Trojan’s original design is based on a standard TLS connection, with proxy authentication performed inside the protected session. In common deployments, the certificate verifies the server’s identity, while the proxy password authenticates the client’s request; they serve different purposes. If the first error in the log is a certificate name mismatch, check the server name in the connection profile against the names covered by the certificate. Don’t reset the proxy password. Check account permissions and password entry only after the secure handshake succeeds and the server explicitly rejects the proxy request.

Certificates also require maintenance. After a server certificate is renewed, an incomplete certificate chain or a different trust store on one device can cause an error on that device alone. That doesn’t necessarily mean the protocol is incompatible, and disabling validation isn’t a good long-term fix. Check the system date and time, server name, certificate chain, and connection target. Switching from a hostname to an IP address can also change the conditions used to verify the domain. For more help, see the TLS certificate troubleshooting guide.

Shadowsocks: the cipher method and credentials must match

Shadowsocks, often shortened to SS, was designed as a relatively simple proxy protocol. In common deployments, both sides agree in advance on an encryption method and credentials; unlike standard TLS, the protocol doesn’t require a website certificate setup. This keeps basic configurations compact, but makes the method name an important compatibility check. If the two sides use different methods, they won’t connect even if the address, port, and password are identical. Changing the method isn’t just a matter of switching a dropdown: the server must support and use the same method.

Shadowsocks has evolved over time. Older stream ciphers, commonly used AEAD methods, and the newer Shadowsocks 2022 schemes need to be considered separately. AEAD combines confidentiality and integrity protection; support for some AEAD methods doesn’t mean a client also supports newer schemes. Those schemes may have specific key formats and length requirements, and a field labeled “password” isn’t always a free-form password field. If the client hides the method in advanced settings, expand them after importing and verify it rather than checking only the profile name and port.

When do protocol differences matter for maintenance?

When taking over an existing service, first find out who updates the connection details and whether client devices can be updated in step. Trojan’s commonly used outer certificate needs maintenance; if the server name and trust chain remain valid, routine renewal usually doesn’t require users to re-enter the proxy password. SS profiles using pre-shared keys depend more on keeping both ends in sync: if the server key changes before devices receive the updated details, those devices are affected immediately. For one device, the number of fields to enter may be obvious; across many devices, how changes are communicated and rolled back is usually more important.

Don’t use a single test to claim that every feature works. For example, successful web browsing only shows that the path used by that application works; it doesn’t prove that another app’s UDP traffic can get through. Check whether both implementations support the required forwarding, whether the client’s traffic-capture mode covers the target app, and whether the server allows that traffic. To test UDP, use an app that you know actually sends UDP traffic and record the result separately. Don’t treat success after an automatic fallback as proof that the original path worked. The same distinction applies to other proxy protocols.

A Trojan certificate validation error isn’t the same as a proxy password error; an SS method mismatch isn’t a password error either. Identify the stage where the connection fails before changing a setting.

03 · Security mechanisms

REALITY: a security layer, not a proxy protocol

Why shared profiles often pair it with VLESS

REALITY originated in the Xray project. It takes a different approach from deploying a certificate for your own site: operators don’t need to issue and install a conventional website certificate for the proxy entry point, but both ends still need matching verification material. Shared profiles commonly pair VLESS with REALITY: VLESS handles proxy requests, while REALITY handles the connection’s security handshake. Calling the pair a single “protocol type” can be convenient in conversation, but configure them separately—and never enter REALITY as the transport type.

Standard TLS and REALITY aren’t equivalent options that can be swapped freely in the same settings field. TLS typically relies on certificate trust and the server name; REALITY requires checking the server name, key-related parameters, short IDs, and other fields against the relevant implementation and configuration. The transport, proxy identity, and flow control still have their own requirements. You can’t keep an existing standard TLS profile working by changing only its security layer. Likewise, two profiles that both use REALITY may still differ in transport and flow-control settings. Similar labels in the interface don’t mean their handshake materials are interchangeable.

Check each field’s role before comparing its value

Treat the server address and server name as separate fields. The address is the connection target; the server name must match the handshake configuration for that profile. The address can be an IP address, and the name doesn’t need to match it. Key-related fields also have distinct roles: the client should enter only the verification material provided for it, never request or enter the server’s private material. A short ID must match a value allowed by the server configuration; it isn’t a display name for users to choose. If the editor folds away these advanced fields, expand them and check them after import.

Some interfaces also let you choose a client handshake fingerprint. This affects how the core constructs the handshake; it doesn’t change certificate validation, replace key material, or guarantee a faster connection. When troubleshooting, start with a complete, known-working profile and avoid changing this option yourself. If a profile worked before an upgrade but fails to import afterward, first check whether the editor retained the field and whether the current core accepts its value. Then consider changing the setting. When interface terminology varies, rely on the actual configuration field and core logs.

Use the failure stage to distinguish input, network, and handshake issues

If the client reports an invalid configuration when you save it, check the field formats and which settings the selected core supports. If the connection times out or is refused when you connect, first check the address, port, and network against the original profile. If the connection reaches the handshake stage but can’t establish a secure session, check the server name, verification material, and short ID. If the secure handshake completes but later requests fail, check the proxy credentials, flow-control settings, and whether the destination service is reachable. If the logs don’t clearly identify the stage, narrow down the reproduction steps instead of trying to infer the faulty field from the total time spent failing.

Evaluate REALITY based on the maintenance requirements of the full configuration. If the service details are stable and your team can control and verify changes on both ends, use a known-working profile as a migration baseline. If the settings come from an external source and you can’t confirm their origin or support in your current core, ask the provider for a complete, supported profile. Copying one parameter from someone else’s configuration only adds another variable. To understand the concepts first, use the glossary to distinguish transports from security layers, then compare the fields in your editor.

04 · Core and client

V2Fly and Xray: similar configurations aren’t interchangeable

Project lineage and client names are different things

Project V is a useful starting point for understanding the V2Ray ecosystem. V2Fly continues to maintain core projects in that ecosystem; Xray emerged from the same technical lineage, then evolved independently and added capabilities including REALITY. They share familiar concepts in basic inbound, outbound, and routing models, but that history doesn’t mean their fields have always stayed in sync. Seeing common names such as inbounds and outbounds means the structure is familiar; it doesn’t prove that every subfield or default behavior is the same.

Graphical clients handle importing and editing profiles, starting the core, and interacting with system network settings; the core handles the connections themselves. For desktop, start with v2rayN. When comparing standard and WPF editions on Windows, you’re primarily comparing supported systems and interfaces—not proving that every connection setting is identical based on the package name. On Android, v2rayNG primarily uses Xray, while v2flyNG corresponds to the V2Fly ecosystem and can be used with existing deployments. See the client downloads page to choose a client, or compare clients to review interfaces and features.

Check compatibility at three stages: import, load, and behavior

Import happens in the graphical interface: the importer must recognize the shared text and map its fields to a local profile. It may silently ignore newer fields instead of showing an error. Loading happens in the core: it must understand the configuration generated by the client and the combination of settings. Behavior is what happens after connecting: differences in routing, resolution, or the default outbound can change the path used by an app, even when the interface says the core is running. Check these three stages separately to distinguish parsing problems from forwarding problems.

When migrating a full configuration, start by reusing one clearly defined outbound connection and verifying the destination service. Then migrate routing and resolution gradually. Moving every rule at once makes it hard to tell whether a new failure comes from an incompatible core field or a rule sending the test app through a different outbound. Differences in defaults can also change behavior when explicit rules are missing. Record the test domain, app, and expected route, then verify at least one connection that should use the proxy and one that should connect directly under the rules.

Quick example: change the log level without changing the connection

Common JSON configurations for both core families use the following top-level field to set the log level. This is a mergeable configuration snippet, not a standalone, runnable proxy configuration. If a log object already exists, change only its loglevel and preserve the existing log destination and other fields. If the interface rebuilds the configuration, change the setting in the interface instead. Use warning for everyday operation; temporarily switch to info when needed to reproduce an issue, then restore the original level.

{
  "log": {
    "loglevel": "warning"
  }
}

Higher log levels may record destination domains, connection addresses, or subscription details. When reporting a problem, share only a redacted error excerpt and remove anything that could reveal your profile. When comparing logs from two clients, don’t focus only on how many messages they produce: find the first error and check the state immediately before and after it. To distinguish a local listener, remote outbound, or routing issue, start with a guide to the structure of V2Ray configuration files and compare the relevant part of the configuration generated by the client instead of editing the whole file.

05 · Performance testing

Speed and resource use: measure handshakes, transport, and system overhead separately

First response time and sustained throughput answer different questions

A page request may involve DNS resolution, establishing the underlying connection, completing the transport or security handshake, and finally receiving a response from the destination app. Time to first usable response combines all of these factors. If a tool only checks whether a port is reachable—or doesn’t make the core complete proxy authentication—it can’t tell you whether real browsing is faster. For everyday browsing of short pages, first-response time and its variability are closer to what you feel. Large files and long transfers depend more on sustained throughput and interruptions.

A client may reuse DNS results or an existing connection for a second request, so its timing doesn’t represent the first handshake. Compare in two rounds: one with as consistent a cold-start condition as possible for every request, and another sending the same kind of requests repeatedly to observe connection reuse. You can still compare results if you can’t clear every cache; just note which conditions you couldn’t control and keep cold-start and reused-connection results separate. Multiple samples are more useful than a single best-case result.

Keep endpoints, workloads, and test conditions consistent

Choose several known-working endpoints and keep the server location, access network, destination, time of day, and client traffic-capture mode as consistent as possible. If you can, compare protocol combinations in the same controlled server environment and alternate the test order so that changes in network conditions aren’t attributed to whichever option you test last. If you can only compare profiles from different services, the results can still guide your choice, but describe them as “Profile A was more stable in this test,” not “Protocol X is faster.” Endpoint routing, service throttling, and server load can outweigh protocol differences.

Measure resource use at idle and under load. At idle, check whether the client and core processes remain active. Under traffic, use the same file or task to compare CPU use and completion time, and see whether memory drops after the task. Looking only at the graphical client can miss a separate process handling traffic forwarding; a brief increase in working set isn’t necessarily a memory leak. For longer tests, repeat the same task and check whether memory keeps settling at a higher level after each run. Account for logs, caches, and other background processes.

Why protocol overhead doesn’t fit into a fixed ranking

VMess has its own authentication and protection mechanisms. VLESS’s actual overhead depends on its security layer and transport; Trojan’s performance is affected by TLS session setup and reuse, while SS depends on the selected encryption method and implementation. Hardware acceleration, crypto libraries, and core scheduling can all change the results. Two setups may look much the same on a broadband desktop but show CPU differences on a less powerful device or under sustained concurrent load. You also can’t assume REALITY is faster than standard TLS based on its name alone.

A useful test log can be simple: record the endpoint and test time, then note new-connection response time, sustained transfer speed, failures or retries, and CPU behavior under load. If you enable a virtual network adapter or change routing, describe which apps the test covers; don’t mix those results directly with an earlier single-app traffic-capture test. Choose the metric closest to your own use as the primary one and use the rest to understand trade-offs. For example, prioritize worst-case response times for interactive use, and sustained throughput and recovery after interruptions for large transfers.

06 · Android testing

Mobile battery use: separate encryption load from background wakeups

How persistent connections, retries, and wireless links affect battery life

A phone’s battery use isn’t just about core processing. Even when an app sends only a small amount of data, the network interface may need to wake from a low-power state; it may not return to its lowest power state immediately afterward. Frequent keepalives, repeated reconnects after network changes, and background syncing can affect standby battery life more than a little extra encryption during foreground browsing. Retransmissions and reconnects on weak signals also complicate the picture. Don’t attribute one battery drop directly to a protocol; first determine whether the phone was idle, transferring data, or repeatedly retrying.

On Android, VPN mode usually covers more traffic than configuring a proxy for a single app. When more apps fall within the VPN’s scope, the core handles more traffic and the CPU and wireless interface may stay active more often. That doesn’t necessarily mean the protocol uses more power. Likewise, when a virtual network adapter captures traffic, packets may still pass through local processing even if an app bypasses the proxy tunnel. Choose a full-device VPN or per-app coverage based on what your apps need, then compare resource use across configurations with the same coverage.

Test standby, light use, and sustained transfers separately

Start standby testing with a baseline: keep the same connection type, stable signal, screen-off state, and similar background activity, then observe natural battery drain without the client. Next, compare two profiles on the same phone with the same traffic-capture scope and similar starting conditions. Note separately if the system updates, runs a backup, or switches networks during the test. Battery percentages are coarse over short periods, so a single percentage-point change isn’t meaningful. Observe several comparable time windows and compare background activity on the system’s battery screen.

For light-use testing, follow your normal routine by opening the same pages or apps, and note whether loading often stalls or takes a long time after the screen turns off and on. For sustained transfers, use the same content and record completion time, heat, and any retries. One setup may use slightly more CPU but finish sooner, so its total energy use may not be higher. Another may use less CPU per second but consume more power in everyday use because interruptions trigger repeated retries. At minimum, report the screen state and network type.

If the connection drops with the screen locked, check whether the service is running before changing protocols

If v2rayNG or v2flyNG works only while the phone is unlocked, first check Android’s VPN status and whether the client service is still running after the screen locks. If the service was paused, stopped, or replaced by another VPN session, investigate system permissions and background policies. If it’s still running but disconnects only after a network change, focus on connectivity and recovery over that network. Some systems have per-app battery settings; note the original settings before changing only the client that needs to run continuously. Allowing continuous background activity also affects standby results, so don’t change background policies and then attribute the change to the protocol.

Use battery results to make a specific choice. If high drain occurs only around network changes, prefer a profile that reconnects reliably over one with the lowest idle use. If the difference appears only during large transfers, compare completion time and temperature under the same workload. If the difference is smaller than normal day-to-day variation, stick with the option that’s easier to update and verify. To distinguish system traffic-capture issues from handshake problems, use the Troubleshooting FAQ to narrow down the cause, then repeat the test in this section.

07 · Import and migration

Subscription compatibility: importing successfully doesn’t guarantee every field made it

Subscription URLs, share links, and full configurations explained

A subscription URL is an endpoint a client uses to fetch content; it isn’t the address and port required to connect to a server. The fetched content might be a list of share links, encoded text, or a structured configuration. A single share link usually describes one connection and doesn’t preserve subscription groups, update intervals, or the full routing policy. A complete core configuration may include inbounds, multiple outbounds, and DNS settings. These formats are all text, but they have different import paths and client requirements; seeing the same names in a file doesn’t make them interchangeable.

A typical vmess:// share link carries encoded structured data. Links such as vless:// and trojan:// usually organize fields using an address, query parameters, and a label; ss:// also has several formats. These aren’t a single, unified subscription protocol. Encoding is just a representation, not encryption, and being able to open the content doesn’t mean the current client can interpret every parameter. Don’t send a subscription URL or full share link to an untrusted conversion site: the profile may contain working credentials, and the URL may grant access to an entire group of profiles.

Find the failure by checking fetch, parsing, and connection in order

If the list is empty after an update, first check whether the client actually fetched subscription content, rather than an authentication prompt, error page, or empty response. Use the client’s update status and logs to confirm that the subscription is valid and the update applied to the expected group. A subscription opening in a browser doesn’t guarantee the client receives the same content: the browser may already be logged in or may use a different network path. If fetching failed, don’t start by changing a connection’s flow-control setting; the client may not have received that profile at all.

If the client fetches the content but imports only some entries, check whether the missing ones share a protocol, transport, or unusual format. If all entries appear but connections fail, open a representative profile and check which fields changed. Look especially for empty or default values replacing settings, such as a server address being present while the original server name or security-layer parameters are missing. Labels can change, so don’t rely on them alone to identify the same profile. Compare the address, port, protocol, and security-layer combination, then test the connection.

Keep a rollback sample before converting profiles or updating them in bulk

Conversion can only reformat information already present in a profile; it can’t invent server-side handshake material or authorization requirements. When exporting to another format, the target may lack an equivalent field or a reliable way to preserve that setting. The output may import successfully and still behave differently. First ask the provider for the original format supported by your target client. If migration is necessary, test one profile in a separate group, verify that important values survive an update, and only then migrate similar entries in bulk.

Don’t delete the original group before testing. Note the currently selected profile and any routing dependencies, verify that a representative profile in the new group works, and check after the next update whether the selected profile was replaced. If multiple devices use the same subscription, test the update on one device first so you still have a comparison point if migration fails. For expired content, malformed encoding, or update-path issues, follow the steps in the subscription and parsing troubleshooting checklist instead of switching protocols back and forth.

08 · Choosing a setup

Choosing a setup: narrow the options to what your current environment supports

Using an existing service: reproduce a working configuration first

If you already have server details, protocol choice is first a compatibility requirement, not a performance setting you can change at will. Confirm the proxy protocol, outer security mechanism, and transport in the profile, then make sure the client core supports that combination. For desktop, start with v2rayN. On Android, check v2rayNG first for profiles that explicitly require Xray features; consider v2flyNG if the provider maintains the service for V2Fly features and fields. Don’t replace a long-running, stable connection with a new protocol and then try to make the server details fit.

For example, if two devices share a subscription, don’t start by comparing their speed-test results. Find one profile that shows complete parameters on both devices, then test the same app request on each. If it works on one device but not the other, hold the network and test destination constant and compare the imported settings and core. If it fails on both, first investigate the profile update, server status, or a shared network condition instead of changing clients on both devices. This preserves a reference point and reduces duplicate troubleshooting.

If you control both ends, set requirements based on deployment and app needs

If you manage the devices and server, write down maintenance responsibilities before comparing options. With reliable certificate renewal, domain management, and client-side validation, you can evaluate Trojan or a suitable proxy configuration using TLS. If both ends only need to agree on a supported SS method and credentials can be rotated in a coordinated way, there’s no need to add maintenance work just to get more options in the interface. For VLESS with REALITY, make sure the people responsible for both ends can verify the handshake fields and that client devices can keep using a compatible core.

Choose based on the apps you actually use. If you only need browser access, first verify stable responses from your usual destinations. If you need specific UDP traffic, make actual reachability over that path a requirement. If you frequently switch networks, prioritize reconnect recovery and behavior when the screen is locked over throughput. For deployments across several devices, the oldest or slowest-to-update device often determines which features you can use. A new combination working on a main computer doesn’t mean an older device can use it; complete a full test there before planning the migration order and rollback window.

Document acceptance criteria you can verify again

A few lines are enough: client and core, proxy protocol and security layer, transport, test network, target app, and result. Define specific pass criteria—for example, the first request completes, continued use has no noticeable interruptions, the connection recovers after a network change, and traffic that should bypass the proxy still does so. Mark anything you couldn’t verify instead of treating it as a pass by default. When you update the client or server configuration later, repeat the same tests to distinguish interface changes, configuration changes, and variations in the environment rather than relying on memory to determine which profile used to be more stable.

If every candidate passes, keep the setup with clearly sourced parameters, a straightforward update process, and issues you can trace to a specific layer. When speed is similar but maintenance effort differs substantially, migrating for one impressive test result usually isn’t worthwhile. To set up a connection, return to Getting Started and build a profile you can verify. If you already have a problem, check the Troubleshooting FAQ first, then use the first useful error to find the relevant section. Choose based on repeatable results, not whether a protocol name sounds newer.

First verify that the client and server work with the same settings, then test the apps you actually use, and only then compare speed and battery use. Change one variable at a time and keep a rollback copy.