Error trying to setup security/xray-core client

I have a VPS on which I set up an Xray + VLESS + Reality VPN using 3x-ui panel. Now I can use that VPN on my Android phone using Hiddify app. I scanned the QR code generated by the GUI panel interface and it made a proper client config that can be used to connect to the server from phone.

Now, I'd like to also be able to connect to this VPN from my FreeBSD machine. There's a port security/xray-core, which seems to be the client. I copied a client JSON config from Hiddify app:
JSON:
{
    "outbounds": [
        {
            "type": "vless",
            "tag": "vless-temcbun",
            "server": "<my-VPS-IP>",
            "server_port": 21193,
            "uuid": "<my-client-uuid>",
            "tls": {
                "enabled": true,
                "server_name": "dl.google.com",
                "utls": {
                    "enabled": true,
                    "fingerprint": "chrome"
                },
                "reality": {
                    "enabled": true,
                    "public_key": "<my-client-public-key>",
                    "short_id": "<short-id>"
                }
            },
            "transport": {
                "type": "xhttp",
                "mode": "auto",
                "path": "/",
                "xPaddingBytes": "100-1000"
            },
            "packet_encoding": "xudp"
        }
    ]
}
and I wrote it into /usr/local/etc/xray-core/06_outbounds.json.

Now I want to try the whole thing out and start it, but I got an error (as root):
Code:
# /usr/local/etc/rc.d/xray onestart
Starting xray.
Xray 26.3.27 (Xray, Penetrates Everything.) Custom (go1.26.4 freebsd/amd64)
A unified platform for anti-censorship.
2026/06/30 23:58:00.735374 Using confdir from arg: /usr/local/etc/xray-core
2026/06/30 23:58:00.735731 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/00_log.json Format:json}
2026/06/30 23:58:00.736098 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/01_api.json Format:json}
2026/06/30 23:58:00.736103 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/02_dns.json Format:json}
2026/06/30 23:58:00.736136 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/03_routing.json Format:json}
2026/06/30 23:58:00.736144 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/04_policy.json Format:json}
2026/06/30 23:58:00.736162 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/05_inbounds.json Format:json}
2026/06/30 23:58:00.736198 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/06_outbounds.json Format:json}
2026/06/30 23:58:00.736228 [Info] infra/conf: [/usr/local/etc/xray-core/06_outbounds.json] prepend outbound with tag: vless-temcbun
2026/06/30 23:58:00.736232 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/07_transport.json Format:json}
2026/06/30 23:58:00.736235 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/08_stats.json Format:json}
2026/06/30 23:58:00.736248 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray-core/09_reverse.json Format:json}
Failed to start: main: failed to load config files: [/usr/local/etc/xray-core/00_log.json /usr/local/etc/xray-core/01_api.json /usr/local/etc/xray-core/02_dns.json /usr/local/etc/xray-core/03_routing.json /usr/local/etc/xray-core/04_policy.json /usr/local/etc/xray-core/05_inbounds.json /usr/local/etc/xray-core/06_outbounds.json /usr/local/etc/xray-core/07_transport.json /usr/local/etc/xray-core/08_stats.json /usr/local/etc/xray-core/09_reverse.json] > infra/conf: failed to build outbound config with tag vless-temcbun > infra/conf: failed to load outbound detour config for protocol  > infra/conf: unknown config id:

The error itself:
Code:
infra/conf: failed to build outbound config with tag vless-temcbun
> infra/conf: failed to load outbound detour config for protocol
> infra/conf: unknown config id:
doesn't help me much (I have no idea how to fix it) :(

I'm very-very new to network related things (don't have much experience), so I'd like to ask for some help to troubleshoot and solve this issue.
I'd appreciate any help!
 
There's a port security/xray-core, which seems to be the client.
No, similar to security/openvpn it can be configured for all sorts of tasks, as client, server or anything in between.

Never used security/xray-core, but looking at the default configuration files it seems you're probably missing some other parts of the configuration, it's not only 06_outbounds.json that needs to be configured. The other files are mostly empty.
 
It turned out that the config that I obtained from Hiddify is not quite suitable for security/xray-core format: it is a one for net/sing-box. So I first had to translate it into security/xray-core format:

/usr/local/etc/xray-core/06_outbounds.json
JSON:
{
    "outbounds": [
        {
            "tag": "proxy",
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "<my-VPS-IP>",
                        "port": 21193,
                        "users": [
                            {
                                "id": "<my-client-uuid>",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "xhttp",
                "security": "reality",
                "realitySettings": {
                    "serverName": "dl.google.com",
                    "publicKey": "<my-client-public-key>",
                    "shortId": "<short-id>",
                    "fingerprint": "chrome"
                },
                "xhttpSettings": {
                    "path": "/",
                    "mode": "auto"
                }
            }
        }
    ]
}

And I also set up inbounds:
/usr/local/etc/xray-core/05_inbounds.json
JSON:
{
    "inbounds": [
        {
            "tag": "socks-in",
            "protocol": "socks",
            "listen": "127.0.0.1",
            "settings": {
                "udp": true,
                "auth": "noauth",
                "ip": "127.0.0.1"
            },
            "port": 1080
        }
    ]
}

In order to start a client, you can use either:
/etc/rc.conf
Code:
xray_enable="YES"
or
Code:
# /usr/local/etc/rc.d/xray onestart

After that, you can use local SOCKS5 local proxy server (at 127.0.0.1:1080); for instance, to check your current IP:
Code:
curl --socks5 127.0.0.1:1080 ifconfig.me
if everything is set up correctly, it should print a public IP address of your VPS that was specified in /usr/local/etc/xray-core/06_outbounds.json.

To make arbitrary programs use this SOCKS5 proxy, one can use net/proxychains-ng. Create a ~/.proxychains/proxychains.conf config file:
Code:
dynamic_chain
proxy_dns

tcp_read_time_out 15000
tcp_connect_time_out 8000

[ProxyList]
# format: type  host        port   [user pass]
socks5  127.0.0.1  1080

and then use it like this:
Code:
proxychains curl ifconfig.me

Now, it may be a little bit more challenging to make your browser use it: for instance, for www/firefox you have to make sure that network.proxy.socks_remote_dns and network.dns.disablePrefetch are set to true in about:config. In my case, pages were loading a little bit slow at first, but after reloading them a couple of times, everything starts to work fine.
 
Back
Top