V2RayXS: A simple GUI for Xray on macOS

Last update: Jun 19, 2022

V2RayXS: A simple GUI for Xray on macOS

Build Status

Attention: If you want to use v2ray-core version please install the original project. https://github.com/Cenmrev/V2RayX

This repo is based on the Cenmrev/V2RayX project for maintenance and update, uses the Xray-core implementation to support the VLESS and XTLS protocol, and the copyright of the application belongs to the original author @Contents. Pay tribute to @Contents, Thanks to the @XTLS community and all contributors

What is V2Ray?

READ THIS: Project V2Ray.

YOU SHOULD READ V2RAY'S OFFICIAL INSTRUCTION BEFORE USING V2RAYX!

Other V2Ray clients on macOS: V2RayU. (Not related to or endorsed by authors of this repo. USE AT YOUR OWN RISK. The project may have failed.)

What is XTLS? Xray?

READ THIS: XTLS? Xray? V2Ray?.

YOU SHOULD READ XTLS'S OFFICIAL INSTRUCTION BEFORE USING V2RAYXS!

Download V2RayX

Download from Releases. (compiled by travis-ci.org).

By Homebrew-Cask.

brew cask install v2rayx

How to build

V2RayXS.app is built by running one of the following commands in your terminal. You can install this via the command-line with curl.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/tzmax/V2RayXS/master/compilefromsource.sh)"

or step by step:

git clone --recursive https://github.com/tzmax/V2RayXS.git

open V2RayXS.xcodeproj and use Xcode to build V2RayXS.

How does V2RayXS work

V2RayXS provides a GUI to generate the config file for V2Ray. It includes Xray's binary executable in the app bundle. V2RayXS starts and stops V2Ray with launchd of macOS.

V2RayXS also allows users to change system proxy settings and switch proxy servers on the macOS menu bar.

As default, V2RayXS will open a socks5 proxy at port 1081 as the main inbound, as well as a http proxy at port 8001 as an inboundDetour.

V2RayXS provide three modes:

  • Global Mode: V2RayXS asks macOS to route all internet traffic to xray core if the network traffic obeys operating system's network rules.
  • PAC Mode: macOS will determine the routing based on a pac file and some traffic may be routed to xray core.
  • Manual Mode: V2RayXS will not modify any macOS network settings, but only start or stop xray core.

Options in menu list Routing Rule determine how xray core deals with incoming traffic. Core routing rules apply to all three modes above.

auto-run on login

Open macOS System Preferences -> Users & Group -> Login Items, add V2RayXS.app to the list.

manually update xray-core

replace V2RayXS.app/Contents/Resources/v2ray with the newest xray version from xray-core repo. However, compatibility is not guaranteed.

If you want to use v2ray-core version please install the original project. https://github.com/Cenmrev/V2RayX

Uninstall

V2RayXS will create the following files and folders:

  • /Library/Application Support/V2RayXS
  • ~/Library/Application Support/V2RayXS
  • ~/Library/Preferences/cenmrev.V2RayXS.plist

So, to totally uninstall V2RayXS, just delete V2RayXS.app and the files above. :)

Acknowledge

V2RayXS uses GCDWebServer to provide a local pac server. V2RayXS also uses many ideas and codes from ShadowsocksX, especially, the codes of v2rays_sysconfig are simply copied from shadowsocks_sysconf with some modifications.

Donation

If Project V2Ray or V2RayX (V2RayXS) helped you, you can also help us by donation in your will.

To donate to Project V2Ray, you may refer to this page.

To donate to Project Xray, you may refer to this page.

Disclaimer

This tool is mainly for personal usage. For professional users and technique support, commercial software like proxifier is recommended. Please refer to #60.

The Maintaining developers need to complete school courses. So V2rayXS will not be updated frequently. Users can replace V2RayXS.app/Contents/Resources/xray with the newest Xray-core downloaded from https://github.com/XTLS/Xray-core/releases.

The developer currently does not have enough time to add more features to V2RayXS, nor to merge PRs. However, forking and releasing your own version are always welcome.

GitHub

https://github.com/tzmax/V2RayXS
Comments
  • 1. 添加订阅后程序闪退

    请回答下列问题。不按模板发的 issue 将直接被关闭。

    1. 如果你没有遇到任何错误和不正常,请在此处回答你想发表的内容:

    2. 你正在使用哪个版本的 V2RayX,你的 macOS 系统版本? v2rayXS 1.5.2 macos 12.3.1

    3. 如果你在操作 V2RayX 的时候遇到程序崩溃/无反应,请描述你的操作,之后在命令行(终端.app)里运行/Applications/V2RayX.app/Contents/MacOS/V2RayX,重复上述操作直至软件崩溃,把终端里的输出贴到下面指定的地方。

    在这里贴上终端的输出
    ```facaiMacBookPro-2:~ facai$ /Applications/V2RayXS.app/Contents/MacOS/V2RayXS
    [INFO] GCDWebServer started on port 8070 and reachable at http://xx.xx.xx.xx:xxxx/
    2022-04-11 17:15:40.801 V2RayXS[12466:159328] pac file is switched to pac.js
    2022-04-11 17:15:40.809 V2RayXS[12466:159328] 0, -1
    2022-04-11 17:15:40.810 V2RayXS[12466:159328] updatePacMenuList
    2022-04-11 17:15:51.277 V2RayXS[12466:159328] <NSSegmentedControl: 0x7fdc67f6ee50>
    2022-04-11 17:15:51.278 V2RayXS[12466:159328] (
        "enter your subscription link here"
    )
    2022-04-11 17:16:01.791 V2RayXS[12466:159336] Settings saved.
    2022-04-11 17:16:02.630 V2RayXS[12466:159333] -[NSNull isEqualToString:]: unrecognized selector sent to instance 0x7ff85261b0c0
    2022-04-11 17:16:02.632 V2RayXS[12466:159333] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull isEqualToString:]: unrecognized selector sent to instance 0x7ff85261b0c0'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x00007ff80fb501e3 __exceptionPreprocess + 242
    	1   libobjc.A.dylib                     0x00007ff80f8b0c13 objc_exception_throw + 48
    	2   CoreFoundation                      0x00007ff80fbd4f3b -[NSObject(NSObject) __retain_OA] + 0
    	3   CoreFoundation                      0x00007ff80fab6df5 ___forwarding___ + 1356
    	4   CoreFoundation                      0x00007ff80fab6818 _CF_forwarding_prep_0 + 120
    	5   V2RayXS                             0x000000010d1b1e8c V2RayXS + 220812
    	6   V2RayXS                             0x000000010d1b143a V2RayXS + 218170
    	7   V2RayXS                             0x000000010d1a0658 V2RayXS + 149080
    	8   libdispatch.dylib                   0x00007ff80f8520cc _dispatch_call_block_and_release + 12
    	9   libdispatch.dylib                   0x00007ff80f853317 _dispatch_client_callout + 8
    	10  libdispatch.dylib                   0x00007ff80f862c0c _dispatch_root_queue_drain + 673
    	11  libdispatch.dylib                   0x00007ff80f86325c _dispatch_worker_thread2 + 160
    	12  libsystem_pthread.dylib             0x00007ff80fa0af8a _pthread_wqthread + 256
    	13  libsystem_pthread.dylib             0x00007ff80fa09f57 start_wqthread + 15
    )
    libc++abi: terminating with uncaught exception of type NSException
    Abort trap: 6
    facaiMacBookPro-2:~ facai$ 
    
    
    3) 如果 V2RayX 没有发生崩溃,但是有一些不正常行为,比如上次勾选了 mux,再次打开,mux 的钩没有了。请描述你遇到的不正常行为。
    
    4) 如果 V2RayX 一切正常,但网络依然不如你所预料,请首先把 log level 切换到 debug,再次访问你想访问的网站。然后点击 V2RayX 的 `view current config.json`,将弹出的浏览器内的配置文件粘贴到下面指定的地方,但是隐藏掉ip/端口/id等信息。
    
    ```javascript
    在这里粘贴配置文件内容
    

    然后点击 V2RayX 的view log,把 error.log 中的输出贴到下方:

    在这里贴上 error.log
    
    1. 其他你认为可以帮助开发者和你一起解决问题的信息:
    Reviewed by chenxiccc at 2022-04-11 09:18
  • 2. How about the router rather than PAC

    I think it could be better if we could bypass the dataflow by router rather than PAC. It's a more "*ray way" to solve this problem and be supported by them, it could also be better to work with proxifier and other software. It's definately a graceful way to solve the traffic loopback.

    Thanks for your work! We need you.

    Reviewed by Johnshall at 2022-03-18 07:27
  • 3. Bypass rules lost after editing domain list

    V2rayXS 1.5.2 macos 12.3.1

    Reproduce steps:

    1. click server setting from v2rayxs in menubar
    2. advanced
    3. rules
    4. Bypasscn_private_apple
    5. edit 0:direct domain list, insert a line, such as "domain:facaix.fun"
    6. save
    7. finish
    8. ok
    9. reopen step 5, found all domain rules lost
    Reviewed by chenxiccc at 2022-04-15 04:00
  • 4. A problem about AppDelegate/getV2rayPath method

    https://github.com/tzmax/V2RayXS/blob/1e71a983ae4d1d0ddf69db578e9bc1da7597dd39/V2RayX/AppDelegate.m#L1004-L1010

    这里为什么要判断 v2ray, v2ctl 文件是否存在?难道不应该判断 xray 文件是否存在就可以了吗?

    Reviewed by hulixia1992 at 2022-06-02 19:07
  • 5. 可以直接在V2RayXS中显示log吗

    请回答下列问题。不按模板发的 issue 将直接被关闭。

    1. 如果你没有遇到任何错误和不正常,请在此处回答你想发表的内容: 请问可以直接在V2RayXS中显示log吗?而不是写到文件中,这样可以快速查看问题。
    2. 你正在使用哪个版本的 V2RayX,你的 macOS 系统版本? V2RayXS v1.5.2,macOS 12.3.1
    3. 如果你在操作 V2RayX 的时候遇到程序崩溃/无反应,请描述你的操作,之后在命令行(终端.app)里运行/Applications/V2RayX.app/Contents/MacOS/V2RayX,重复上述操作直至软件崩溃,把终端里的输出贴到下面指定的地方。
    在这里贴上终端的输出
    
    1. 如果 V2RayX 没有发生崩溃,但是有一些不正常行为,比如上次勾选了 mux,再次打开,mux 的钩没有了。请描述你遇到的不正常行为。

    2. 如果 V2RayX 一切正常,但网络依然不如你所预料,请首先把 log level 切换到 debug,再次访问你想访问的网站。然后点击 V2RayX 的 view current config.json,将弹出的浏览器内的配置文件粘贴到下面指定的地方,但是隐藏掉ip/端口/id等信息。

    在这里粘贴配置文件内容
    

    然后点击 V2RayX 的view log,把 error.log 中的输出贴到下方:

    在这里贴上 error.log
    
    1. 其他你认为可以帮助开发者和你一起解决问题的信息:
    Reviewed by wswday at 2022-05-19 14:09
  • 6. 最新版V2RayXS无法上外网

    请回答下列问题。不按模板发的 issue 将直接被关闭。

    1. 如果你没有遇到任何错误和不正常,请在此处回答你想发表的内容:

    2. 你正在使用哪个版本的 V2RayX,你的 macOS 系统版本? V2RayXS 1.5.2(2),macOS 10.13.6 (17G14042)

    3. 如果你在操作 V2RayX 的时候遇到程序崩溃/无反应,请描述你的操作,之后在命令行(终端.app)里运行/Applications/V2RayX.app/Contents/MacOS/V2RayX,重复上述操作直至软件崩溃,把终端里的输出贴到下面指定的地方。

    在这里贴上终端的输出
    
    1. 如果 V2RayX 没有发生崩溃,但是有一些不正常行为,比如上次勾选了 mux,再次打开,mux 的钩没有了。请描述你遇到的不正常行为。

    2. 如果 V2RayX 一切正常,但网络依然不如你所预料,请首先把 log level 切换到 debug,再次访问你想访问的网站。然后点击 V2RayX 的 view current config.json,将弹出的浏览器内的配置文件粘贴到下面指定的地方,但是隐藏掉ip/端口/id等信息。 用V2RayXS无法访问外网,国内网站正常。但V2RayX连接vmess连接,或者平板用v2rayNG开局域网代理给电脑,是可以正常上外网的。

    在这里粘贴配置文件内容
    {
      "dns" : {
        "servers" : [
          "localhost"
        ]
      },
      "inbounds" : [
        {
          "listen" : "127.0.0.1",
          "port" : 1081,
          "protocol" : "socks",
          "tag" : "socksinbound",
          "settings" : {
            "auth" : "noauth",
            "udp" : false,
            "ip" : "127.0.0.1"
          }
        },
        {
          "listen" : "127.0.0.1",
          "port" : 8001,
          "protocol" : "http",
          "tag" : "httpinbound",
          "settings" : {
            "timeout" : 0
          }
        }
      ],
      "outbounds" : [
        {
          "sendThrough" : "0.0.0.0",
          "mux" : {
            "enabled" : false,
            "concurrency" : 8
          },
          "protocol" : "vless",
          "settings" : {
            "vnext" : [
              {
                "address" : "xxxx.xxxx.top",
                "users" : [
                  {
                    "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
                    "alterId" : 64,
                    "security" : "auto",
                    "level" : 0,
                    "encryption" : "none"
                  }
                ],
                "port" : xxxxx
              }
            ]
          },
          "tag" : "anders",
          "streamSettings" : {
            "sockopt" : {
    
            },
            "quicSettings" : {
              "key" : "",
              "security" : "none",
              "header" : {
                "type" : "none"
              }
            },
            "tlsSettings" : {
              "allowInsecure" : false,
              "alpn" : [
                "http\/1.1"
              ],
              "serverName" : "server.cc",
              "allowInsecureCiphers" : false
            },
            "wsSettings" : {
              "path" : "",
              "headers" : {
    
              }
            },
            "httpSettings" : {
              "path" : "",
              "host" : [
                ""
              ]
            },
            "tcpSettings" : {
              "header" : {
                "type" : "none"
              }
            },
            "kcpSettings" : {
              "header" : {
                "type" : "none"
              },
              "mtu" : 1350,
              "congestion" : false,
              "tti" : 20,
              "uplinkCapacity" : 5,
              "writeBufferSize" : 1,
              "readBufferSize" : 1,
              "downlinkCapacity" : 20
            },
            "security" : "none",
            "network" : "tcp"
          }
        }
      ],
      "routing" : {
        "name" : "all_to_main",
        "domainStrategy" : "AsIs",
        "rules" : [
          {
            "type" : "field",
            "outboundTag" : "anders",
            "port" : "0-65535"
          }
        ]
      },
      "log" : {
        "error" : "\/var\/folders\/d0\/wp4v2n5j06l1v68g2n5n_4ym0000gn\/T\/cenmrev.v2rayx.log\/error.log",
        "loglevel" : "debug",
        "access" : "\/var\/folders\/d0\/wp4v2n5j06l1v68g2n5n_4ym0000gn\/T\/cenmrev.v2rayx.log\/access.log"
      }
    }
    

    然后点击 V2RayX 的view log,把 error.log 中的输出贴到下方:

    在这里贴上 error.log
    2022/04/28 18:35:22 [Debug] app/log: Logger started
    2022/04/28 18:35:22 [Info] app/dns: DNS: created localhost client
    2022/04/28 18:35:22 [Debug] app/proxyman/inbound: creating stream worker on 127.0.0.1:1081
    2022/04/28 18:35:22 [Debug] app/proxyman/inbound: creating stream worker on 127.0.0.1:8001
    2022/04/28 18:35:22 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:1081
    2022/04/28 18:35:22 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:8001
    2022/04/28 18:35:22 [Warning] core: Xray 1.5.3 started
    2022/04/28 18:35:24 [Info] [2007627377] proxy/http: request to Method [CONNECT] Host [github.com:443] with URL [//github.com:443]
    2022/04/28 18:35:24 [Info] [2007627377] app/dispatcher: taking detour [anders] for [tcp:github.com:443]
    2022/04/28 18:35:24 [Info] [2007627377] transport/internet/tcp: dialing TCP to tcp:xxxx.xxxx.top:xxxxx
    2022/04/28 18:35:24 [Debug] transport/internet: dialing to tcp:xxxx.xxxx.top:xxxxx
    2022/04/28 18:35:24 [Info] [2007627377] proxy/vless/outbound: tunneling request to tcp:github.com:443 via xxxx.xxxx.top:xxxxx
    2022/04/28 18:35:24 [Info] [2007627377] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: connection ends > proxy/vless/outbound: failed to decode response header > proxy/vless/encoding: failed to read response version > read tcp 192.168.2.13:61191->xx.xx.xxx.xxx:xxxxx: read: connection reset by peer
    2022/04/28 18:35:24 [Info] [2007627377] app/proxyman/inbound: connection ends > proxy/http: connection ends > io: read/write on closed pipe
    2022/04/28 18:35:43 [Debug] app/log: Logger closing
    
    
    1. 其他你认为可以帮助开发者和你一起解决问题的信息:
    Reviewed by vqsld at 2022-04-28 10:49
  • 7. Where to config xtls and xtls-rprx-splice in v2rayXS gui ?

    I've installed xray with xray-agent in my VPS. After installation, it shows me a list of configs, such as

    ---> 格式化明文(VLESS+TCP+TLS/xtls-rprx-direct) 协议类型:VLESS,地址:x.xxxxx.xx,端口:443,用户ID:0000000-00000-0000-00000000,**安全:xtls**,传输方式:tcp,**flow:xtls-rprx-direct**,账户名:x.xxxxx.xx_VLESS_XTLS/TLS-direct_TCP

    ---> 格式化明文(VLESS+TCP+TLS/xtls-rprx-splice) 协议类型:VLESS,地址:x.xxxxx.xx,端口:443,用户ID:00000-000000-00000-000000000,**安全:xtls**,传输方式:tcp,**flow:xtls-rprx-splice**,账户名:x.xxxxx.xx_VLESS_XTLS/TLS-splice_TCP

    But I can't find where to config xlts and flow in gui.

    Reviewed by chenxiccc at 2022-04-17 05:10
Related tags
Show a macOS notification when GPG is waiting for you to tap/touch a security device (e.g. YubiKey).
Show a macOS notification when GPG is waiting for you to tap/touch a security device (e.g. YubiKey).

GPG Tap Notifier (for macOS) GPG Tap Notifier is a Swift rewrite of klali/scdaemon-proxy for macOS. What does it do? This app provides reminders to to

Jun 8, 2022
QueryKit, a simple type-safe Core Data query language.
QueryKit, a simple type-safe Core Data query language.

QueryKit QueryKit, a simple type-safe Core Data query language. Usage QuerySet<Person>(context, "Person")

Jun 16, 2022
100% Swift Simple Boilerplate Free Core Data Stack. NSPersistentContainer
100% Swift Simple Boilerplate Free Core Data Stack. NSPersistentContainer

DATAStack helps you to alleviate the Core Data boilerplate. Now you can go to your AppDelegate remove all the Core Data related code and replace it wi

Jun 7, 2022
A simple application for retrieving lunch menus of selected restaurants around FIT CTU
A simple application for retrieving lunch menus of selected restaurants around FIT CTU

lunch_guy-ios (in progress) A simple application for retrieving lunch menus of selected restaurants using https://github.com/tomaskadlec/lunch_guy API

Feb 10, 2022
Simple IOS notes app written programmatically without storyboard using UIKit and CoreData
Simple IOS notes app written programmatically without storyboard using UIKit and CoreData

Notes Simple Notes app. Swift, UIKit, CoreData Description Simple IOS notes app

Mar 22, 2022
Xray is viewDebugging tool for iOS, tvOS, watchOS and macOS
Xray is viewDebugging tool for iOS, tvOS, watchOS and macOS

XRay XRay is view debugging tool for iOS. Currently, XRay can show all of the view hierarchies in UIKit. For SwiftUI, I'm working on it. XRay helps yo

Jun 10, 2022
macOS GUI Library for the Nim Programming Language
macOS GUI Library for the Nim Programming Language

NimCocoa NimCocoa is an experimental implementation of a Native GUI for the Nim programming language running on macOS. Rather than rely on low level c

Mar 11, 2022
A GUI based virtualisation tool for running Linux on macOS Big Sur (x86 or arm64)
A GUI based virtualisation tool for running Linux on macOS Big Sur (x86 or arm64)

Project Mendacius GUI based virtualization tool to run Linux, based on the Virtualization framework introduced by Apple for macOS Big Sur with support

Jun 21, 2022
A simple GUI for starting/stopping our various local development environments
A simple GUI for starting/stopping our various local development environments

EnvironmentLauncher A simple GUI for starting/stopping SchoolMint's various local development environments Before you begin, some notes This is a WIP

May 17, 2022
StarryStars is iOS GUI library for displaying and editing ratings
StarryStars is iOS GUI library for displaying and editing ratings

StarryStars StarryStars is iOS GUI library for displaying and editing ratings Features StarryStars' RatingView is both IBDesignable and IBInspectable

May 28, 2022
SwiftOverlays is a Swift GUI library for displaying various popups and notifications
SwiftOverlays is a Swift GUI library for displaying various popups and notifications

SwiftOverlays is a Swift GUI library for displaying various popups and notifications. SwiftOverlays animated logo is kindly made by Crafted Pixels Fea

May 28, 2022
Demo using Terminal.Gui with Llama Swift
Demo using Terminal.Gui with Llama Swift

Hola! This repo is a demo which shows the use of Llama Swift with Terminal.Gui. Llama is my exploratory project to compile "other languages" for .NET

May 22, 2021
Fastbot is a model-based testing tool for modeling GUI transitions to discover app stability problems

Fastbot is a model-based testing tool for modeling GUI transitions to discover app stability problems. It combines machine learning and reinforcement learning techniques to assist discovery in a more intelligent way.

Jun 21, 2022
GUI library for displaying various popups (HUD), written in pure Swift.
 GUI library for displaying various popups (HUD), written in pure Swift.

SwiftNotice SwiftNotice is a GUI library for displaying various popups (HUD) written in pure Swift, fits any scrollview and supports iPhone X. Feature

May 30, 2022
StarryStars is iOS GUI library for displaying and editing ratings
StarryStars is iOS GUI library for displaying and editing ratings

StarryStars StarryStars is iOS GUI library for displaying and editing ratings Features StarryStars' RatingView is both IBDesignable and IBInspectable

May 28, 2022
Basic (simple) App for MacOS with simple functionality
Basic (simple) App for MacOS with simple functionality

Test Mac App Basic (simple) App for MacOS with simple functionality General Details Build : 1.0 Author Alias : gonewithharshwinds Brand : ADV Descript

Dec 25, 2021
A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework.
A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework.

macOS Virtual Machine A ARM macOS Virtual Machine, using macOS 12's new Virtualization framework. I copied KhaosT's code from here, all I did is chang

Jun 16, 2022
macOS application written in SwiftUI that downloads installer pkgs for the Install macOS Big Sur application.
macOS application written in SwiftUI that downloads installer pkgs for the Install macOS Big Sur application.

Download Full Installer This is a Swift UI implementation of my fetch-installer-pkg script. It will list the full macOS Big Sur (and later) installer

Jun 15, 2022
"Podman for macOS" is a macOS frontend for Podman.

Podman for macOS "Podman for macOS" is a macOS frontend for Podman. It can be used to start and stop both the Podman Machine and its running container

Jun 25, 2022
Tool for running macOS guest virtual machines in macOS 12 host or higher on M1 arm64 Macs

macosvm macosvm is a command line tool which allows creating and running of virtual machines on macOS 12 (Monterey) using the new Virtualization frame

Jun 17, 2022