V2Ray WebSocket+TLS Mode Troubleshooting | First-Time Setup Failed

 If this is your first-time setup V2Ray server, this troubleshooting guide could help you a lot.

Make sure you did exactly what the tutorial said.

If you are not familiar with V2Ray, you should follow every step exactly as the tutorial said. If you have a different output, or red text, or 'error' in output, from any steps and commands, please take a screenshot or copy the log. 

Do not report an error with only your own description.
Do not report only the error result at the end of your setup process.

My tutorials usually include an example log file at the end. Please compare the log file with the one that you had - you might be able to find what you have done wrong there.

You followed the tutorial exactly and carefully?

You failed on one step, or can't connect the server after a successful setup process.

This can happen, for various different reasons. Do not attempt to re-run the script - it'll likely make NO DIFFERENCE.

Please check the items below:

(If one item is OK, you usually don't need to check the sub-items)

1.  Can you connect without traffic routed through a CDN(set up in the last step)?

(Please notice that if you setup a server on IPv6 only VPS, you can only connect to it via IPv6 without CDN)

2. Can you connect If you re-run the script with another domain?

(Please notice that www.mydomain.com, mydomain.com, and abc.mydomian.com are different domains. Therefore, you just need to change the prefix to get a new domain at the DNS settings)

3.  Is v2ray running correctly?

Enter the following command on your VPS:

service v2ray status 

Please notice whether the status is 'active (running)' and whether there is any 'error' or 'warning' in the log

service v2ray status check v2ray running status and recent log

3.1 Is config.json written correctly?

Enter the following command on your VPS:
(Please notice the path to your files)
/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json -test

The path to your files may vary depending on how you set up your server (which script you use). You can find the entire command whilst looking at the v2ray status using 'service v2ray status':

Use -test check config.json formatting
To whatever is there in the location above, add ' -test' to the end (make sure you add a space).

If it says 'Configuration OK', then config.json is written correctly.
Configuration OK means config.json is written correctly

3.2 Is user privilege set correctly?

Can you run v2ray as the user which you used to run the setup script?
Enter the following command on your VPS:

/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json

Is there any 'error' or 'waning' in the output? 

Can you connect? 

4. Is caddy running correctly?

Enter the following command on your VPS:

service caddy status 

Please notice whether the status is 'active (running)' and whether there is any 'error' or 'warning' in the log 

4.1 Did caddy get SSL certificate successfully?

Enter the following command on your VPS:
(Please change the blue part to your own domain)

find / -name "*chacuoganzao.ipv6a.my.id*"

Is there any .crt .key file? 

Check .crt .key file of domain

5. Can you visit your domain via browser

https://chacuoganzao.ipv6a.my.id/

Can you see your camouflage site?

Check camouflage site

If not, please take a screenshot and carry on to the next step. 

5.1 Check DNS result on your VPS

Try seeing if your VPS can see your own website.
Enter the following command on your VPS:

curl https://chacuoganzao.ipv6a.my.id/

Can you see a '</html>' at the end of the output? 

Use curl to test a https web site

5.2 Check DNS result on 3rd party sites

Try using ping.pe (http://ping.pe/) to ping your domain.
https://ping.pe/chacuoganzao.ipv6a.my.id

Did you get a correct result of your domain?

Use ping.pe to ping an IP address or domain

5.3 Check if others can connect to your server's 80 and 443 ports

Use ping.pe (http://ping.pe/) to tcp ping your domain's port.

https://tcp.ping.pe/207.148.79.159:80
https://tcp.ping.pe/207.148.79.159:443
https://tcp6.ping.pe/[2a01:4f8:151:334b:face:452:8586:1]:80
https://tcp6.ping.pe/[2a01:4f8:151:334b:face:452:8586:1]:443
Use tcp.ping.pe to test IP Address : Port

If this command failed, then please recheck if caddy is running. 

Also, check if a firewall is blocking your VPS's 80 and 443 ports.
Enter the following command on your VPS:

which iptables

If it is, close iptables.
Enter the following command on your VPS:

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT

Restart caddy.
Enter the following command on your VPS:

service caddy restart

6. Can you visit your domain/path via browser?

https://chacuoganzao.ipv6a.my.id/a4d265a2ec82

Did you get '400 Bad Request'?

Use web brower to test https://domain/path get 400 Bad Request result

If not, please take a screenshot and carry on to the next step.  

6.1 If you can get camouflage site via domain, but can't get '400 Bad Request' via domain/path 

That means the data reverse proxied by caddy isn't catched by v2ray. 

Maybe because the reasons below:

  • The path in Caddyfile is not the same as you typed in browser.
  • v2ray is not running.
  • The reverse proxy port in Caddyfile is not the same as the listen port in config.json
The reverse proxy port in Caddyfile should be the same as the listen port in config.json

Log is the best description of the error

You can set Xshell to record log automatically.

You can use screenshot tool to scrolling capture the command window.


PS

Many thanks to @day_cat for proofreading.


评论

The Hot3 in Last 30 Days