Skip to content

Commit c53f09a

Browse files
committed
(chore): Consolidate proxies/ into examples/
1 parent 3305edd commit c53f09a

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ COPY . .
3737

3838
EXPOSE 8080 8081 8025
3939

40-
CMD ["php", "proxies/http.php"]
40+
CMD ["php", "examples/http.php"]

benchmarks/compare-http-servers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ proxy_fast_assume_ok=${COMPARE_FAST_ASSUME_OK:-true}
2525
proxy_server_mode=${COMPARE_SERVER_MODE:-base}
2626

2727
cleanup() {
28-
pkill -f "proxies/http.php" >/dev/null 2>&1 || true
28+
pkill -f "examples/http.php" >/dev/null 2>&1 || true
2929
pkill -f "php benchmarks/http-backend.php" >/dev/null 2>&1 || true
3030
}
3131
trap cleanup EXIT
@@ -51,7 +51,7 @@ start_backend() {
5151

5252
start_proxy() {
5353
local impl="$1"
54-
pkill -f "proxies/http.php" >/dev/null 2>&1 || true
54+
pkill -f "examples/http.php" >/dev/null 2>&1 || true
5555
nohup env \
5656
HTTP_SERVER_IMPL="${impl}" \
5757
HTTP_BACKEND_ENDPOINT="${backend_host}:${backend_port}" \
@@ -64,7 +64,7 @@ start_proxy() {
6464
HTTP_BACKEND_POOL_SIZE="${proxy_pool}" \
6565
HTTP_KEEPALIVE_TIMEOUT="${proxy_keepalive}" \
6666
HTTP_OPEN_HTTP2="${proxy_http2}" \
67-
php -d memory_limit=1G proxies/http.php > /tmp/http-proxy.log 2>&1 &
67+
php -d memory_limit=1G examples/http.php > /tmp/http-proxy.log 2>&1 &
6868

6969
for _ in {1..20}; do
7070
if curl -s -o /dev/null -w "%{http_code}" "http://${host}:${port}/" | grep -q "200"; then

benchmarks/compare-tcp-servers.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [ -z "$coro_reactor" ]; then
6666
fi
6767

6868
cleanup() {
69-
pkill -f "proxies/tcp.php" >/dev/null 2>&1 || true
69+
pkill -f "examples/tcp.php" >/dev/null 2>&1 || true
7070
pkill -f "php benchmarks/tcp-backend.php" >/dev/null 2>&1 || true
7171
}
7272
trap cleanup EXIT
@@ -97,7 +97,7 @@ start_backend() {
9797

9898
start_proxy() {
9999
local impl="$1"
100-
pkill -f "proxies/tcp.php" >/dev/null 2>&1 || true
100+
pkill -f "examples/tcp.php" >/dev/null 2>&1 || true
101101
for _ in {1..20}; do
102102
if php -r '$s=@stream_socket_client("tcp://'\"${host}:${port}\"'", $errno, $errstr, 0.2); if ($s) { fclose($s); exit(0);} exit(1);' >/dev/null 2>&1; then
103103
sleep 0.25
@@ -116,7 +116,7 @@ start_proxy() {
116116
TCP_REACTOR_NUM="${coro_reactor}" \
117117
TCP_DISPATCH_MODE="${proxy_dispatch}" \
118118
TCP_SKIP_VALIDATION=true \
119-
php -d memory_limit=1G proxies/tcp.php > /tmp/tcp-proxy.log 2>&1 &
119+
php -d memory_limit=1G examples/tcp.php > /tmp/tcp-proxy.log 2>&1 &
120120
done
121121
else
122122
nohup env \
@@ -128,7 +128,7 @@ start_proxy() {
128128
TCP_REACTOR_NUM="${proxy_reactor}" \
129129
TCP_DISPATCH_MODE="${proxy_dispatch}" \
130130
TCP_SKIP_VALIDATION=true \
131-
php -d memory_limit=1G proxies/tcp.php > /tmp/tcp-proxy.log 2>&1 &
131+
php -d memory_limit=1G examples/tcp.php > /tmp/tcp-proxy.log 2>&1 &
132132
fi
133133

134134
for _ in {1..20}; do

docker-compose.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22

33
mariadb:
44
image: mariadb:11.2
5-
container_name: protocol-proxy-mariadb
5+
container_name: proxy-mariadb
66
restart: unless-stopped
77
environment:
88
MYSQL_ROOT_PASSWORD: rootpassword
@@ -14,7 +14,7 @@ services:
1414
volumes:
1515
- mariadb_data:/var/lib/mysql
1616
networks:
17-
- protocol-proxy
17+
- proxy
1818
healthcheck:
1919
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
2020
interval: 10s
@@ -23,14 +23,14 @@ services:
2323

2424
redis:
2525
image: redis:7-alpine
26-
container_name: protocol-proxy-redis
26+
container_name: proxy-redis
2727
restart: unless-stopped
2828
ports:
2929
- "${REDIS_PORT:-6379}:6379"
3030
volumes:
3131
- redis_data:/data
3232
networks:
33-
- protocol-proxy
33+
- proxy
3434
healthcheck:
3535
test: ["CMD", "redis-cli", "ping"]
3636
interval: 10s
@@ -39,7 +39,7 @@ services:
3939

4040
http-proxy:
4141
build: .
42-
container_name: protocol-proxy-http
42+
container_name: proxy-http
4343
restart: unless-stopped
4444
ports:
4545
- "${HTTP_PROXY_PORT:-8080}:8080"
@@ -59,12 +59,12 @@ services:
5959
redis:
6060
condition: service_healthy
6161
networks:
62-
- protocol-proxy
63-
command: php proxies/http.php
62+
- proxy
63+
command: php examples/http.php
6464

6565
tcp-proxy:
6666
build: .
67-
container_name: protocol-proxy-tcp
67+
container_name: proxy-tcp
6868
restart: unless-stopped
6969
ports:
7070
- "${TCP_POSTGRES_PORT:-5432}:5432"
@@ -83,12 +83,12 @@ services:
8383
redis:
8484
condition: service_healthy
8585
networks:
86-
- protocol-proxy
87-
command: php proxies/tcp.php
86+
- proxy
87+
command: php examples/tcp.php
8888

8989
smtp-proxy:
9090
build: .
91-
container_name: protocol-proxy-smtp
91+
container_name: proxy-smtp
9292
restart: unless-stopped
9393
ports:
9494
- "${SMTP_PROXY_PORT:-8025}:25"
@@ -106,11 +106,11 @@ services:
106106
redis:
107107
condition: service_healthy
108108
networks:
109-
- protocol-proxy
110-
command: php proxies/smtp.php
109+
- proxy
110+
command: php examples/smtp.php
111111

112112
networks:
113-
protocol-proxy:
113+
proxy:
114114
driver: bridge
115115

116116
volumes:
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)