forked from pufferffish/wireproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30d2697
commit d9c6eb7
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
test: | ||
name: Test wireproxy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setting up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
- name: Install dependencies | ||
run: sudo apt install wireguard curl | ||
- name: Building wireproxy | ||
run: | | ||
git tag dev | ||
make | ||
- name: Generate test config | ||
run: ./test_config.sh | ||
- name: Start wireproxy | ||
run: ./wireproxy -c test.conf & sleep 1 | ||
- name: Test socks5 | ||
run: curl --proxy socks5://localhost:64423 http://zx2c4.com/ip | grep -q "demo.wireguard.com" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
exec 3<>/dev/tcp/demo.wireguard.com/42912 | ||
privatekey="$(wg genkey)" | ||
wg pubkey <<<"$privatekey" >&3 | ||
IFS=: read -r status server_pubkey server_port internal_ip <&3 | ||
[[ $status == OK ]] | ||
cat >test.conf <<EOL | ||
[Interface] | ||
Address = $internal_ip/32 | ||
PrivateKey = $privatekey | ||
DNS = 8.8.8.8 | ||
[Peer] | ||
PublicKey = $server_pubkey | ||
Endpoint = demo.wireguard.com:$server_port | ||
[Socks5] | ||
BindAddress = 127.0.0.1:64423 | ||
EOL |