Skip to content

Commit 9bd223d

Browse files
committed
Bump version 0.1.12
1 parent 63630f7 commit 9bd223d

File tree

5 files changed

+98
-4
lines changed

5 files changed

+98
-4
lines changed

.github/workflows/publish-exe.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ jobs:
6868
powershell Compress-Archive -Path target/${{ matrix.target }}/release/socks-hub.exe, ./README.md, ./socks_hub_ffi.h, target/${{ matrix.target }}/release/socks_hub.dll -DestinationPath mypubdir4/socks-hub-${{ matrix.target }}.zip
6969
elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then
7070
zip -j mypubdir4/socks-hub-${{ matrix.target }}.zip target/${{ matrix.target }}/release/socks-hub ./README.md ./socks_hub_ffi.h target/${{ matrix.target }}/release/libsocks_hub.dylib
71+
if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then
72+
./build-apple.sh
73+
zip -r mypubdir4/socks-hub-apple-xcframework.zip ./socks-hub.xcframework/
74+
fi
7175
elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
7276
zip -j mypubdir4/socks-hub-${{ matrix.target }}.zip target/${{ matrix.target }}/release/socks-hub ./README.md ./socks_hub_ffi.h target/${{ matrix.target }}/release/libsocks_hub.so
7377
fi

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Documentation](https://img.shields.io/badge/docs-release-brightgreen.svg?style=flat)](https://docs.rs/socks-hub)
66
[![Download](https://img.shields.io/crates/d/socks-hub.svg)](https://crates.io/crates/socks-hub)
77
[![License](https://img.shields.io/crates/l/socks-hub.svg?style=flat)](https://github.com/ssrlive/socks-hub/blob/master/LICENSE)
8+
[![Rust](https://img.shields.io/badge/rust-1.70%2B-blue.svg?maxAge=3600)](https://github.com/ssrlive/socks-hub)
89

910
`SOCKS-HUB` is a [SOCKS5](https://en.wikipedia.org/wiki/SOCKS#SOCKS5) proxy `hub`.
1011
It can convert `HTTP`/`HTTPS` proxy to `SOCKS5` proxy, and can also forward `SOCKS5` proxy.
@@ -38,12 +39,12 @@ Usage: socks-hub [OPTIONS] --listen-addr <IP:port> --server-addr <IP:port>
3839
Options:
3940
-t, --source-type <http|socks5> Source proxy type [default: http] [possible values: http, socks5]
4041
-l, --listen-addr <IP:port> Local listening address
41-
-s, --server-addr <IP:port> Remote SOCKS5 server address
4242
-u, --username <username> Client authentication username, available both for HTTP and SOCKS5, optional
4343
-p, --password <password> Client authentication password, available both for HTTP and SOCKS5, optional
44-
--s5-username <username> SOCKS5 server authentication username, optional
45-
--s5-password <password> SOCKS5 server authentication password, optional
46-
-a, --acl-file <path> ACL file path
44+
-s, --server-addr <IP:port> Remote SOCKS5 server address
45+
--s5-username <username> Remote SOCKS5 server authentication username, optional
46+
--s5-password <password> Remote SOCKS5 server authentication password, optional
47+
-a, --acl-file <path> ACL (Access Control List) file path, optional
4748
-v, --verbosity <level> Log verbosity level [default: info] [possible values: off, error, warn, info, debug, trace]
4849
-h, --help Print help
4950
-V, --version Print version

build-apple-debug.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /bin/sh
2+
3+
echo "Setting up the rust environment..."
4+
rustup target add aarch64-apple-ios
5+
cargo install cbindgen
6+
7+
echo "Building target aarch64-apple-ios..."
8+
cargo build --target aarch64-apple-ios
9+
10+
echo "Generating includes..."
11+
mkdir -p target/include/
12+
rm -rf target/include/*
13+
cbindgen --config cbindgen.toml -l C -o target/include/socks-hub.h
14+
cat > target/include/module.modulemap <<EOF
15+
framework module socks-hub {
16+
umbrella header "socks-hub.h"
17+
18+
export *
19+
module * { export * }
20+
}
21+
EOF
22+
23+
echo "Creating XCFramework"
24+
rm -rf ./socks-hub.xcframework
25+
xcodebuild -create-xcframework \
26+
-library ./target/aarch64-apple-ios/debug/libsocks_hub.a -headers ./target/include/ \
27+
-output ./socks-hub.xcframework

build-apple.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#! /bin/sh
2+
3+
echo "Setting up the rust environment..."
4+
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios x86_64-apple-darwin aarch64-apple-darwin
5+
cargo install cbindgen
6+
7+
echo "Building..."
8+
9+
echo "Building target x86_64-apple-darwin..."
10+
cargo build --release --target x86_64-apple-darwin
11+
12+
echo "Building target aarch64-apple-darwin..."
13+
cargo build --release --target aarch64-apple-darwin
14+
15+
echo "Building target aarch64-apple-ios..."
16+
cargo build --release --target aarch64-apple-ios
17+
18+
echo "Building target x86_64-apple-ios..."
19+
cargo build --release --target x86_64-apple-ios
20+
21+
echo "Building target aarch64-apple-ios-sim..."
22+
cargo build --release --target aarch64-apple-ios-sim
23+
24+
echo "Generating includes..."
25+
mkdir -p target/include/
26+
rm -rf target/include/*
27+
cbindgen --config cbindgen.toml -l C -o target/include/socks-hub.h
28+
cat > target/include/module.modulemap <<EOF
29+
framework module socks-hub {
30+
umbrella header "socks-hub.h"
31+
32+
export *
33+
module * { export * }
34+
}
35+
EOF
36+
37+
echo "lipo..."
38+
39+
echo "Simulator"
40+
lipo -create \
41+
target/aarch64-apple-ios-sim/release/libsocks_hub.a \
42+
target/x86_64-apple-ios/release/libsocks_hub.a \
43+
-output ./target/libsocks_hub-ios-sim.a
44+
45+
echo "MacOS"
46+
lipo -create \
47+
target/aarch64-apple-darwin/release/libsocks_hub.a \
48+
target/x86_64-apple-darwin/release/libsocks_hub.a \
49+
-output ./target/libsocks_hub-macos.a
50+
51+
echo "Creating XCFramework"
52+
rm -rf ./socks-hub.xcframework
53+
xcodebuild -create-xcframework \
54+
-library ./target/aarch64-apple-ios/release/libsocks_hub.a -headers ./target/include/ \
55+
-library ./target/libsocks_hub-ios-sim.a -headers ./target/include/ \
56+
-library ./target/libsocks_hub-macos.a -headers ./target/include/ \
57+
-output ./socks-hub.xcframework

cbindgen.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
language = "C"
2+
13
[export]
24
include = ["socks_hub_run", "socks_hub_set_log_callback", "socks_hub_stop"]
35
# exclude = ["Java_com_github_shadowsocks_bg_run", "Java_com_github_shadowsocks_bg_stop"]
6+
7+
[defines]
8+
# "feature = sockshub" = "DEFINE_SOCKSHUB"

0 commit comments

Comments
 (0)