This document describe how to install openresty-xray-cli.

1. Requirements

We will need to access the following public network addresses. If your network has a firewall, you need to add proper rules to white list. 443 443

2. Install orxray agent

  • Please login openresty xray console.

  • Click Add new target machine.

  • Follow the prompts to install agent.

3. Get API token

  • Goto openresty xray console homepage.

  • Under the title of Personal API Tokens there is a button Manager, click it.

  • Click generate new token, input the name of the token, and click generate token.

  • Please save the token, the page show the token only once.

4. Install openresty-xray-cli

If your operating system is RHEL, Centos, use the command below.

yum install -y openresty-xray-cli

If your operating system is Fedora, use the command below.

dnf install -y openresty-xray-cli

If your operating system is Ubuntu, Debian, use the command below.

apt install -y openresty-xray-cli

5. Set the config file

execute the command below.

# orxray --help
error: api_token is not found in config file '/root/.orxray/config'.

Goto https://xxx.xx.xx/security/access-tokens for api_token
Please input api_token:

Please goto https://xxx.xx.xx/security/access-tokens to get api_token and fill the api_token after the prompt.

Try to execute the command below.

$ run-y -e '_probe _oneshot { printf("Hello,world\n"); }' -q

Print the config file again.

# cat ~/.orxray/config

You can see the default_agent is automatically set to local xray agent id, you can change it by yourself.