-
Notifications
You must be signed in to change notification settings - Fork 0
Multi protocol proxy #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 46 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
92a5b9f
Add adapter base
abnegate a5005ac
Performance tweaks
abnegate 722c4c7
Add coroutine server + benchmarks
abnegate aaa8df0
Add CI workflows and update config
abnegate 19a370c
Replace Service classes with Resolver pattern
abnegate 86ca764
Update adapters and servers to use Resolver
abnegate d883ab7
Update proxies, examples, and benchmarks for Resolver
abnegate b52f618
Update tests and add MockResolver
abnegate 2856ece
Update docs
abnegate 36e9663
Fix composer
abnegate caa4cd9
Remove platform
abnegate eebb9c9
Remove redundant dep
abnegate 334ad72
Fix trailing comma in composer.json
abnegate 06a084b
Merge pull request #1 from utopia-php/fix/composer-json-syntax
abnegate 9176c3d
Merge remote-tracking branch 'origin/main' into dev
abnegate e9ba926
perf: optimize TCP proxy for lower latency and higher throughput
abnegate 2abc68d
feat: add Linux performance tuning script for benchmarks
abnegate c1f6893
feat: add production-safe Linux tuning script
abnegate 324274c
feat: add one-shot droplet benchmark bootstrap script
abnegate 47aa0db
feat: add bootstrap test script for debugging
abnegate 90dd36e
fix: bootstrap script PHP/Swoole installation
abnegate bf6553b
docs: add Docker quick-test option to bootstrap script
abnegate e5104c6
feat: add sustained load test benchmark
abnegate 4d91d7d
feat: increase benchmark targets to 1M burst, 100k sustained
abnegate e202f99
Fix bench bootstraps
abnegate 8611a94
Update bench scripts
abnegate dcd9e15
Update docs
abnegate f7257b8
Update docs
abnegate 0723e59
Fix composer
abnegate d0e5d8e
Merge remote-tracking branch 'origin/main' into dev
abnegate e20ebae
(refactor): Use PHP 8.4 property hooks, readonly class, and optimise …
abnegate 2ff9a33
(refactor): Add PHPStan type annotations to HTTP and SMTP servers
abnegate 2eb0137
(refactor): Replace config array with named parameters in TCP server
abnegate 953f5fc
(chore): Update PHPStan memory limit and remove unused import
abnegate ed5a9be
Abstract config
abnegate 3c66bb6
Remove dep
abnegate 2d46040
(feat): Add TLS and TlsContext classes for TCP proxy TLS termination
abnegate 771243b
(feat): Add QueryParser and ReadWriteResolver for read/write split ro…
abnegate 2fac054
(feat): Integrate TLS termination, read/write split, MongoDB support,…
abnegate fe7b9fc
(test): Add tests for QueryParser, read/write split, integration, and…
abnegate 40150e1
(refactor): Collapse adapter hierarchy, add Protocol enum, rename Res…
abnegate 6bad65c
(refactor): Extract query parser to utopia-php/query dependency
abnegate 1d91e37
(test): Update tests for adapter refactor and query parser extraction
abnegate 4b81d8d
(style): Convert test method names from snake_case to camelCase
abnegate e2c66a7
(chore): Update Dockerfile and remove unused files
abnegate 27d1e9e
(docs): Update README to match current codebase
abnegate 5d9b048
fix: resolve CI failures for composer, lint, and unit test workflows
abnegate c13ca9e
fix: use correct query package branch and resolve PHPStan errors
abnegate 48c8f49
fix: relax parse performance threshold for CI runners
abnegate 18d464f
(chore): Remove orphaned docblock, profanity in comments, and section…
abnegate 3305edd
(test): Add 217 unit tests for TLS, Config, byte tracking, endpoint v…
abnegate c53f09a
(chore): Consolidate proxies/ into examples/
abnegate 1032093
(refactor): Remove domain-specific parsing from TCP adapter
abnegate d3ff772
(chore): Rename package from protocol-proxy to proxy
abnegate 8a75490
(test): Add tests for adapter factory callback and onResolve dynamic …
abnegate 6953440
(docs): Rename to Utopia Proxy and update config examples
abnegate e0e5c27
(refactor): Simplify names across src — drop redundant qualifiers and…
abnegate d9b7202
(test): Update tests and examples for renamed properties and methods
abnegate 28f1001
(fix): Resolve all PHPStan max-level errors
abnegate 51920ce
(style): Fix Pint formatting in OnResolveCallbackTest
abnegate c3354ac
(fix): Address CodeRabbit review — query strings, TLS bitmask, r/w sp…
abnegate 4f0bc64
(fix): Use setup-php instead of Docker for unit tests
abnegate 5af1222
(chore): Consolidate benchmarks from 15 files to 6
abnegate ace1056
(chore): Simplify CI triggers to pull_request only
abnegate 293a533
(refactor): Remove read/write split — not a proxy concern
abnegate b8e99eb
(refactor): Replace config and state arrays with typed objects
abnegate a8e43ea
(refactor): Simplify adapter API, consolidate timeouts, apply naming …
abnegate 4d49a05
(feat): Expand protocol support to 25
abnegate 76e26af
(style): Replace FQNs with use imports
abnegate bbaf2da
(refactor): Use Swoole Constant for event names
abnegate 3837d9f
(chore): Remove unsubstantiated performance claims from docblocks
abnegate fe85f89
(refactor): Use \go instead of Coroutine::create
abnegate 1687905
(fix): Address PR review — configurable cache TTL, SMTP EOF check, ra…
abnegate 9ccc5ce
(fix): Enable cache TTL in integration tests that assert cache behavior
abnegate 87543e4
(fix): Address code review findings — SSRF bypass, send checks, Conso…
abnegate 06deef7
(refactor): Use utopia validators for hostname, IP, port, and TLS pat…
abnegate fbeccb7
(refactor): Extract shared HTTP request handling into Handler trait
abnegate 78eea92
(fix): Correct TLSContext filename casing in git index
abnegate 3a1d3cd
(refactor): Remove getName and $name property from Adapter — use clas…
abnegate a975c6d
chore: loosen console version constraint
abnegate 1f2ec5f
(chore): loosen requirements
abnegate 229ca60
(refactor): Move Handler and SwooleCoroutine into Swoole sub-namespace
abnegate 63a0194
(refactor): Move TCP SwooleCoroutine into Swoole sub-namespace
abnegate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,8 @@ | ||
| .git | ||
| .gitignore | ||
| .idea | ||
| vendor | ||
| *.md | ||
| .dockerignore | ||
| Dockerfile | ||
| docker-compose.yml |
This file contains hidden or 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,24 @@ | ||
| # Database Configuration | ||
| DB_HOST=mariadb | ||
| DB_PORT=3306 | ||
| DB_USER=appwrite | ||
| DB_PASS=password | ||
| DB_NAME=appwrite | ||
|
|
||
| # Redis Configuration | ||
| REDIS_HOST=redis | ||
| REDIS_PORT=6379 | ||
|
|
||
| # Compute API Configuration | ||
| COMPUTE_API_URL=http://appwrite-api/v1/compute | ||
| COMPUTE_API_KEY= | ||
|
|
||
| # MySQL Root Password (for docker-compose) | ||
| MYSQL_ROOT_PASSWORD=rootpassword | ||
|
|
||
| # TLS Configuration (for TCP proxy) | ||
| PROXY_TLS_ENABLED=false | ||
| PROXY_TLS_CERT= | ||
| PROXY_TLS_KEY= | ||
| PROXY_TLS_CA= | ||
| PROXY_TLS_REQUIRE_CLIENT_CERT=false |
This file contains hidden or 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,29 @@ | ||
| name: Integration Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| integration: | ||
| name: Integration Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.4' | ||
| extensions: swoole, redis, sockets | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --prefer-dist --no-progress | ||
|
|
||
| - name: Run integration tests | ||
| run: composer test:integration |
This file contains hidden or 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,28 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| pint: | ||
| name: Laravel Pint | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.4' | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --no-interaction --prefer-dist | ||
|
|
||
| - name: Run Pint | ||
| run: composer lint -- --test |
This file contains hidden or 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,29 @@ | ||
| name: Static Analysis | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| phpstan: | ||
| name: PHPStan | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.4' | ||
| extensions: swoole, redis | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --no-interaction --prefer-dist | ||
|
|
||
| - name: Run PHPStan | ||
| run: composer check |
This file contains hidden or 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,24 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| unit: | ||
| name: Unit Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build test image | ||
| run: | | ||
| docker build -t protocol-proxy-test --target test -f Dockerfile.test . | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| docker run --rm protocol-proxy-test composer test |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,16 @@ | ||
| /vendor/ | ||
| /composer.lock | ||
| /.phpunit.cache | ||
| /.phpunit.result.cache | ||
| /.php-cs-fixer.cache | ||
| /phpstan.neon | ||
| /.idea/ | ||
| .DS_Store | ||
| *.log | ||
| /coverage/ | ||
|
|
||
| # Environment files | ||
| .env | ||
|
|
||
| # Docker volumes | ||
| /docker-volumes/ |
This file contains hidden or 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,40 @@ | ||
| FROM php:8.4.18-cli-alpine3.23 | ||
|
|
||
| RUN apk update && apk upgrade && apk add --no-cache \ | ||
| autoconf \ | ||
| g++ \ | ||
| make \ | ||
| linux-headers \ | ||
| libstdc++ \ | ||
| brotli-dev \ | ||
| libzip-dev \ | ||
| openssl-dev \ | ||
| && rm -rf /var/cache/apk/* | ||
|
|
||
| RUN docker-php-ext-install \ | ||
| pcntl \ | ||
| sockets \ | ||
| zip | ||
|
|
||
| RUN pecl channel-update pecl.php.net | ||
|
|
||
| RUN pecl install swoole && \ | ||
| docker-php-ext-enable swoole | ||
|
|
||
| RUN pecl install redis && \ | ||
| docker-php-ext-enable redis | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY composer.json composer.lock ./ | ||
| COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
| RUN composer install \ | ||
| --no-dev \ | ||
| --optimize-autoloader \ | ||
| --ignore-platform-reqs | ||
abnegate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| COPY . . | ||
|
|
||
| EXPOSE 8080 8081 8025 | ||
|
|
||
| CMD ["php", "proxies/http.php"] | ||
abnegate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.