Test Network Access #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Network Access | |
on: | |
workflow_dispatch: | |
jobs: | |
test_network_access: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: | | |
3.6.7 | |
- name: Setup Proxy | |
run: | | |
pip install proxybroker | |
proxybroker serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High --countries IN | |
- name: Setup env proxy | |
run: | | |
export HTTP_PROXY="http://127.0.0.1:8080"; export HTTPS_PROXY="http://127.0.0.1:8080" | |
- name: Test Network Access | |
run: | | |
# Replace 'https://example.com' with the URL you want to test | |
response=$(curl -s api.ipify.org | |
# Check if the request was successful (HTTP status code 200) | |
if [ $? -eq 0 ]; then | |
echo "Network access successful! Response:" | |
echo "$response" | |
else | |
echo "Failed to access the network." | |
fi |