Docs: About

This commit is contained in:
JimhHan
2021-03-14 15:40:53 +08:00
parent 1871b2aa46
commit 28bb4fa275
16 changed files with 8945 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
---
title: 快速入门
---
> **这个章节将告诉您如何用最简单的方式获得Xray,并且开始使用Xray.**
## 下载安装
Xray支持各种平台,并且您可以从多种渠道和方式获得Xray的各种版本.
请点击[如何下载安装Xray](./install)以获取Xray
## 配置运行
下载并安装Xray后,只需对他进行配置即可使用.
请点击[如何配置运行Xray](./config)以学习最简单的配置方式.
## 命令参数
Xray有多种命令和参数可用,因此变得灵活和强大.
请点击[Xray的命令参数](./command)查看Xray的更多命令和参数用法.
## 使用文档
您正在查看的是 Project X 的文档网站. 您可以了解更多网站的使用方式, 或是帮助我们改进文档质量.
请点击[使用文档](./document)进一步查看相关内容
+117
View File
@@ -0,0 +1,117 @@
---
lang: zh-CN
title: 命令参数
---
::: tip
Xray 使用 go 风格的命令及参数
:::
## 获取基本命令
您可以运行 xray help 来获得所有 xray 最基础的用法, 以及可用的命令及说明.
```
Xray is a platform for building proxies.
Usage:
xray <command> [arguments]
The commands are:
run Run Xray with config, the default command
version Show current version of Xray
api Call an API in an Xray process
tls TLS tools
uuid Generate new UUIDs
Use "xray help <command>" for more information about a command.
```
### xray run
指定一个或多个配置文件,并运行。
使用方法:
```
xray run [-c config.json] [-confdir dir]
```
```
Run Xray with config, the default command.
The -config=file, -c=file flags set the config files for
Xray. Multiple assign is accepted.
The -confdir=dir flag sets a dir with multiple json config
The -format=json flag sets the format of config files.
Default "json".
The -test flag tells Xray to test config files only,
without launching the server
```
### xray version
输出 Xray 版本、 Golang 版本等信息。
使用方法:
```
xray version
```
### xray api
调用 Xray 的 gRPC API,需要在配置文件中开启。
使用方法:
```
xray api <command> [arguments]
```
```
restartlogger Restart the logger
stats Get statistics
statsquery Query statistics
statssys Get system statistics
adi Add inbounds
ado Add outbounds
rmi Remove inbounds
rmo Remove outbounds
```
### xray tls
一些与 TLS 相关的工具。
使用方法:
```
xray tls <command> [arguments]
```
```
cert Generate TLS certificates
ping Ping the domain with TLS handshake
```
### xray uuid
生成 UUID。
使用方法:
```
xray uuid
```
::: tip
当`-config`没有指定时,Xray 将先后尝试从以下路径加载`config.json`:
- 工作目录(Working Directory)
- [环境变量](../config/env)中`Xray.location.asset`所指定的路径
:::
+103
View File
@@ -0,0 +1,103 @@
---
lang: zh-CN
title: 配置运行
---
[下载并安装](../install) 了 Xray 之后,您需要对它进行一下配置。
为了演示,这里只介绍简单的配置方式.
如需配置更复杂的功能,请参考更详细的 [配置文件](../../config) 中相关说明。
## 服务端配置
你需要一台防火墙外的服务器,来运行服务器端的 Xray。配置如下:
```json
{
"inbounds": [
{
"port": 10086, // 服务器监听端口
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811"
}
]
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
```
服务器的配置中需要确保 `id` 和端口与客户端一致,就可以正常连接了。
## 客户端配置
在你的 PC(或手机)中,需要用以下配置运行 Xray :
```json
{
"inbounds": [
{
"port": 1080, // SOCKS 代理端口,在浏览器中需配置代理并指向这个端口
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "server", // 服务器地址,请修改为你自己的服务器 ip 或域名
"port": 10086, // 服务器端口
"users": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811"
}
]
}
]
}
},
{
"protocol": "freedom",
"tag": "direct"
}
],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "direct"
}
]
}
}
```
上述配置唯一要更改的地方是你的服务器 IP,配置中已注明。上述配置会把除局域网(比如访问路由器)以外的所有流量转发至你的服务器。
## 运行
- 在 Windows 和 macOS 中,配置文件通常是 Xray 同目录下的 `config.json` 文件。
- 直接运行 `Xray` 或 `Xray.exe` 即可。
- 在 Linux 中,配置文件通常位于 `/etc/xray/` 或 `/usr/local/etc/xray/` 目录下。
- 运行 `xray run -c /etc/xray/config.json`
- 或使用 systemd 等工具将 Xray 作为服务在后台运行。
更多详细的说明可以参考 [配置文档](../../config) 和 [使用心得](../../documents)。
+36
View File
@@ -0,0 +1,36 @@
---
title: 使用文档
lang: zh-CN
---
## 改进文档
Project X 的文档托管在[github](https://github.com/XTLS/XTLS.github.io)上.
您可以通过以下步骤, 提交您对文档的改动:
1. 从[project X 文档仓库](https://github.com/XTLS/XTLS.github.io)打开仓库, 点击右上角的 fork, fork 一份文档仓库的镜像到您自己的 github 仓库.
2. 使用任何您喜欢的工具, 从您克隆的仓库获得文档的克隆, 如:
```
git clone https://github.com/yours/XTLS.github.io
```
3. 基于 main 分支创建新的分支, 如:
```
git checkout -b your-branch
```
4. 在新分支上做修改, 完成后提交修改
5. 推送创建的分支到您的仓库
```
git push -u origin your-branch
```
6. 打开 github, 点击 'Pull request' 向 [project X 文档仓库](https://github.com/XTLS/XTLS.github.io)发出PR.
7. 请在 PR 的标题和正文中,概述此次 PR 新增/修改的内容等;
8. 等待回应, 如果 PR 被 merge, 您做的修改将直接呈现在 [Project X 文档网站](https://xtls.github.io)。
+91
View File
@@ -0,0 +1,91 @@
---
date: "2020-12-23T00:00:00.000Z"
description: Project X 的文档.
title: 下载安装
weight: 1
---
## 平台支持
Xray 在以下平台中可用:
- Windows 7 及之后版本(x86 / amd64 / arm32);
- macOS 10.10 Yosemite 及之后版本(amd64);
- Linux 2.6.23 及之后版本(x86 / amd64 / arm / arm64 / mips64 / mips / ppc64 / s390x / riscv64);
- 包括但不限于 Debian 7 / 8、Ubuntu 12.04 / 14.04 及后续版本、CentOS 7 / 8、Arch Linux 等;
- FreeBSD (x86 / amd64);
- OpenBSD (x86 / amd64);
- Dragonfly BSD (amd64);
## 下载 Xray
预编译的二进制 ZIP 格式压缩包可在 [Github Releases](https://github.com/xtls/Xray-core/releases) 中找到。
下载对应平台的压缩包,解压后即可使用。
## 验证安装包
Xray 提供两种验证方式:
- ZIP 压缩包的 SHA1 / SHA256 摘要
- 可复现构建:请参照 [编译 Xray](../development/build.html)
## Windows 安装方式
- 在 [Github Releases](https://github.com/xtls/Xray-core/releases) 下载适用于 Windows 平台的 ZIP 压缩包,解压后可得到可执行文件 `xray.exe`,然后[通过命令行带参数运行](../command) 即可
- 通过 [Scoop](https://scoop.sh) 包管理器安装:Xray 已经被添加到 [Mochi](https://github.com/Qv2ray/mochi)。
- 通过 [Chocolatey](https://chocolatey.org) 包管理器安装:[Xray](https://chocolatey.org/packages/xray/1.3.1),感谢 [Markson](https://chocolatey.org/profiles/markson_ho)
## macOS 安装方式
- 在 [Github Releases](https://github.com/xtls/Xray-core/releases) 下载适用于 macOS 平台的 ZIP 压缩包,解压后可得到可执行文件 `xray`,然后[通过命令行带参数运行](../command) 即可
- 通过 [Homebrew](https://brew.sh) 包管理器安装:<Badge text="WIP" type="warning"/>
## Linux 安装方式
### 安装脚本
- Linux Script
- [Xray-install](https://github.com/XTLS/Xray-install)
- [Xray-script](https://github.com/kirin10000/Xray-script)
- One Click
- [ProxySU](https://github.com/proxysu/ProxySU)
- [Xray-agent](https://github.com/mack-a/Xray-agent)
- Magisk
- [Xray4Magisk](https://github.com/CerteKim/Xray4Magisk)
- [Xray_For_Magisk](https://github.com/E7KMbb/Xray_For_Magisk)
### Linux 发行版包管理器
Linux 发行版 Xray 包(可通过发行版相应的包管理器安装):
- Debian <Badge text="WIP" type="warning"/>
- Arch Linux <Badge text="WIP" type="warning"/>
### Linuxbrew 包管理器 <Badge text="WIP" type="warning"/>
## Docker 安装方式
- [teddysun/xray](https://hub.docker.com/r/teddysun/xray)
- Xray-docker
### Docker image 的文件结构
- `/etc/xray/config.json`:配置文件
- `/usr/bin/xray`:Xray 主程序
- `/usr/local/share/xray/geoip.dat`:IP 数据文件
- `/usr/local/share/xray/geosite.dat`:域名数据文件
## 更多更多...
您可以点击 [传送至众多大佬集结区的任意门](../../links) 获取更多资源
## FAQ <Badge text="WIP" type="warning"/>