gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
i want bash script for all my v2ray config to test proxy work or not, can you help me?
- User
i want bash script for all my v2ray config to test proxy work or not, can you help me?
- Assistant
Sure! I can help you with that. Here's a bash script that you can use to test if your V2Ray proxy is working or not:
bash#!/bin/bash # Replace with your proxy settings PROXY_ADDRESS="127.0.0.1" PROXY_PORT="1080" # Test URLs TEST_URLS=("http://example.com" "https://example.com") # Loop through each URL and test the proxy for url in "${TEST_URLS[@]}"; do # Test with cURL if curl -sS --proxy ${PROXY_ADDRESS}:${PROXY_PORT} ${url} >/dev/null; then echo "Proxy is working for ${url}" else echo "Proxy is not working for ${url}" fi # Test with wget if wget -q -O- --proxy=on --proxy-http=${PROXY_ADDRESS}:${PROXY_PORT} ${url} >/dev/null; then echo "Proxy is working for ${url} (via wget)" else echo "Proxy is not working for ${url} (via wget)" fi done