-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
58 lines (46 loc) · 1.55 KB
/
Copy pathsetup.sh
File metadata and controls
58 lines (46 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Setup script for V2Ray WebSocket+TLS Proxy with Cloudflare Workers
echo "====================================================="
echo "V2Ray WebSocket+TLS Proxy with Cloudflare Workers Setup"
echo "====================================================="
echo
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "Error: npm is not installed. Please install Node.js and npm first."
echo "Visit https://nodejs.org/ for installation instructions."
exit 1
fi
# Check if Wrangler is installed
if ! command -v wrangler &> /dev/null; then
echo "Wrangler CLI not found. Installing Wrangler..."
npm install -g wrangler
fi
echo "Creating Wrangler configuration file..."
# Create wrangler.toml
cat > wrangler.toml << EOL
name = "v2ray-proxy"
main = "v2ray_proxy_worker.js"
compatibility_date = "2023-09-01"
[vars]
# You can add custom environment variables here if needed
# EXAMPLE_VAR = "example_value"
# Customize the following settings as needed
[triggers]
crons = []
EOL
echo "Wrangler configuration created."
echo
# Login to Cloudflare
echo "Please log in to your Cloudflare account..."
wrangler login
# Deploy the worker
echo
echo "Deploying the V2Ray proxy worker to Cloudflare..."
wrangler deploy
echo
echo "====================================================="
echo "Setup complete! Your V2Ray proxy worker is now deployed."
echo
echo "You can access your proxy at the URL shown above."
echo "Follow the instructions in README.md to configure your V2Ray clients."
echo "====================================================="