24 Commits
Author SHA1 Message Date
Denozordec c3a0a771a3 Enhance Mihomo WebSocket functionality and testing for connections
Publish telemt-api gateway Docker image / test (push) Successful in 25s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m18s
- Added support for WebSocket connections to the `/connections` endpoint, allowing for improved handling of WebSocket requests.
- Updated the `useMihomoWebSocketTunnel` function to accept `Sec-WebSocket-Key` for `/connections`, enhancing compatibility with various proxies.
- Introduced new test cases in `mihomo_test.go` to validate WebSocket tunnel behavior for connections, ensuring comprehensive coverage.
- Enhanced the `applyMihomoWSDialAuth` function to manage token handling for WebSocket connections, improving security and functionality.
- Updated Svelte components to implement native WebSocket loops for connections, providing real-time data updates and improved user experience.
2026-03-31 11:54:18 +07:00
Denozordec 49f36d2b8b Enhance Mihomo WebSocket functionality and testing
Publish telemt-api gateway Docker image / test (push) Successful in 24s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m59s
- Added support for the Gorilla WebSocket library to improve WebSocket handling in Mihomo.
- Refactored the WebSocket upgrade detection logic to utilize `websocket.IsWebSocketUpgrade`, enhancing reliability.
- Updated the `NewMihomoForward` function to streamline request handling and improve path normalization.
- Introduced new test cases for WebSocket tunnel scenarios, ensuring comprehensive coverage for traffic and memory endpoints.
- Improved error handling and connection management for WebSocket upgrades, ensuring robust communication.
2026-03-31 11:41:56 +07:00
Denozordec 7e88cfcb3e Refactor Mihomo WebSocket handling and enhance tests
Publish telemt-api gateway Docker image / test (push) Successful in 25s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m59s
- Updated the WebSocket upgrade detection logic in `isWebSocketUpgrade` to improve header handling and added a fallback for the "Sec-WebSocket-Key" header.
- Refactored the WebSocket proxy logic to use a new `newMihomoWSTunnel` function, enhancing the connection handling process.
- Introduced comprehensive test cases in `TestIsWebSocketUpgrade` to validate various WebSocket upgrade scenarios, ensuring robust functionality.
- Improved error handling and request building for WebSocket upgrades, ensuring secure and efficient communication.
2026-03-31 11:19:40 +07:00
Denozordec 65d153df99 Implement WebSocket proxy handling in Mihomo
Publish telemt-api gateway Docker image / test (push) Successful in 25s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m8s
- Added a new function to handle WebSocket connections, including hijacking the client connection and establishing a connection to the upstream WebSocket server.
- Enhanced error handling for connection issues and improved request cloning for WebSocket upgrades.
- Introduced utility functions for dialing WebSocket upstream and writing raw HTTP errors, ensuring robust communication and error reporting.
- Refactored the existing proxy logic to accommodate the new WebSocket handling, improving overall functionality and reliability.
2026-03-31 10:52:16 +07:00
Denozordec 77a6c1e31e Enhance WebSocket upgrade detection in Mihomo
Publish telemt-api gateway Docker image / test (push) Successful in 26s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m57s
- Updated the `isWebSocketUpgrade` function to improve handling of WebSocket upgrade requests by considering the presence of the "Sec-WebSocket-Key" header as a strong indicator.
- Added a new test case in `TestIsWebSocketUpgrade` to validate the detection logic for requests with the "Sec-WebSocket-Key" header, ensuring comprehensive test coverage.
2026-03-31 10:28:06 +07:00
Denozordec 1686840b0e Add WebSocket upgrade handling and tests in Mihomo
Publish telemt-api gateway Docker image / test (push) Successful in 26s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m0s
- Implemented enhanced logic in `isWebSocketUpgrade` to accurately determine WebSocket upgrade requests by checking both "Connection" and "Upgrade" headers.
- Added a new test function `TestIsWebSocketUpgrade` to validate the WebSocket upgrade detection logic, ensuring correct behavior for various header configurations.
2026-03-31 10:22:37 +07:00
Denozordec b1839c5ebe Update Mihomo documentation and proxy handling for improved error debugging
- Enhanced `GATEWAY_RUN.md` with detailed debugging steps for handling **400** errors in Mihomo routes, clarifying the configuration requirements and common pitfalls.
- Updated comments in `internal/proxy/mihomo.go` to reflect changes in error handling and proxy behavior, linking to the new debugging section in the documentation.
- Modified the Svelte component logic to ensure proper filtering of selectable groups, improving the user interface for managing Mihomo proxies.
2026-03-31 01:21:15 +07:00
Denozordec 0aa440477e Refactor Mihomo proxy to support WebSocket upgrades and enhance alias forwarding
Publish telemt-api gateway Docker image / test (push) Successful in 29s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m17s
- Introduced a new function `newAliasForward` to handle alias remapping for users, improving the flexibility of the proxy.
- Updated `NewMihomoForward` to differentiate between HTTP and WebSocket requests, ensuring proper handling of both types.
- Enhanced comments for clarity on the proxy behavior and request handling, improving maintainability.
2026-03-31 01:13:36 +07:00
Denozordec b8bb5bede8 Enhance Mihomo proxy behavior and test coverage
Publish telemt-api gateway Docker image / test (push) Successful in 27s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m17s
- Updated the Mihomo proxy implementation to ensure the client Host header is removed from outgoing requests, preventing strict upstream servers from returning errors.
- Revised the test for Mihomo forwarding to verify that the Host header is correctly set and not forwarded to the upstream server, improving test reliability and coverage.
2026-03-31 01:04:01 +07:00
Denozordec ed785cb8f3 Update Mihomo configuration and documentation for clarity
Publish telemt-api gateway Docker image / test (push) Successful in 28s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m10s
- Revised comments in `config.example.yaml` to enhance understanding of Mihomo integration, including environment variable usage and Docker Compose setup.
- Updated `docker-compose.yml` comments to clarify the relationship between the gateway and Mihomo service.
- Enhanced `GATEWAY_RUN.md` to provide clearer instructions on configuring Mihomo parameters and their usage in the gateway.
2026-03-31 00:54:41 +07:00
Denozordec 2d7b06260e Implement Mihomo external-controller support in configuration and gateway
Publish telemt-api gateway Docker image / test (push) Successful in 34s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m55s
- Added optional Mihomo configuration fields in `config.compose.yaml` and `config.example.yaml` for enhanced integration with the Mihomo external-controller.
- Updated the `Gateway` to handle Mihomo API requests, including proxying and error handling for Mihomo-specific endpoints.
- Enhanced the documentation in `GATEWAY_RUN.md` to guide users on configuring Mihomo integration.
- Introduced new utility functions in the web client for interacting with Mihomo API endpoints, improving the overall user experience.
- Updated the sidebar in the Svelte components to include a link to the Mihomo section, enhancing navigation.
2026-03-31 00:32:19 +07:00
Denozordec 0885597ac0 Add net/url import to forward.go for URL handling
Publish telemt-api gateway Docker image / test (push) Successful in 25s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m0s
- Introduced the net/url package import in forward.go to facilitate URL manipulation and enhance request processing in the proxy.
- This change sets the groundwork for future improvements in URL handling and routing logic within the proxy implementation.
2026-03-30 11:50:33 +07:00
Denozordec 374b4e0d71 Refactor reverse proxy and enhance API routing
Publish telemt-api gateway Docker image / test (push) Failing after 26s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
- Replaced the existing reverse proxy implementation with a new alias forwarding mechanism, improving path handling and request normalization.
- Updated the gateway to utilize the new forwarding approach, ensuring consistent handling of API requests and proper error management.
- Enhanced tests to validate the new routing behavior, including handling of double slashes and user endpoint requests.
- Improved documentation in GATEWAY_RUN.md to clarify the updated API routing and configuration requirements.
2026-03-30 11:47:50 +07:00
Denozordec a52dff4944 Enhance API path normalization and configuration validation
Publish telemt-api gateway Docker image / test (push) Successful in 25s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m14s
- Introduced a new function to normalize request URL paths, collapsing duplicate slashes and clearing raw paths to ensure correct routing in the reverse proxy.
- Updated the gateway to utilize the normalization function for API requests, improving routing consistency.
- Trimmed whitespace from server configuration fields in the validation process to prevent potential issues with malformed URLs.
- Enhanced documentation in GATEWAY_RUN.md to clarify the importance of proper URL formatting and configuration.
2026-03-30 11:29:58 +07:00
Denozordec 368473de59 Enhance API routing and testing for user endpoints
Publish telemt-api gateway Docker image / test (push) Successful in 24s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m52s
- Updated the reverse proxy to redirect `GET` requests for `/api/{alias}/users` to `/v1/stats/users`, ensuring compatibility with Telemt builds that handle these requests differently.
- Added tests to verify that `GET` and `HEAD` requests to `/api/{alias}/users` are correctly rewritten, while `POST` requests and user-specific retrievals remain unchanged.
- Improved documentation in GATEWAY_RUN.md to clarify the behavior of the API routing and the importance of using the correct base URL.
2026-03-30 11:18:36 +07:00
Denozordec 89638d29bb Improve URL assertion logic in reverse proxy tests. Updated assertSameURL function in reverse_test.go to handle nil URLs and enhance comparison logic, ensuring more accurate URL mismatch reporting and better test reliability.
Publish telemt-api gateway Docker image / test (push) Successful in 29s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m25s
2026-03-30 00:36:50 +07:00
Denozordec 0dfe14b347 Refactor reverse proxy tests to improve path rewriting assertions. Updated reverse_test.go to introduce a captureTransport for validating outgoing requests and added new tests for director path rewrites, enhancing test reliability and coverage for nested API routes.
Publish telemt-api gateway Docker image / test (push) Failing after 30s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
2026-03-30 00:34:37 +07:00
Denozordec e1c6b2ab49 Enhance reverse proxy transport configuration for improved performance. Updated reverse.go to set a direct transport for the reverse proxy, ensuring more efficient request handling. Modified gateway.go to utilize the direct transport with customized connection settings, optimizing idle connections and timeouts.
Publish telemt-api gateway Docker image / test (push) Failing after 27s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
2026-03-30 00:31:46 +07:00
Denozordec 5934d059a4 Refactor reverse proxy tests to utilize context-aware requests. Updated reverse_test.go to create HTTP requests using context, improving test reliability and aligning with best practices for request handling. This change ensures that tests are more robust and less prone to issues related to request context.
Publish telemt-api gateway Docker image / test (push) Failing after 32s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
2026-03-30 00:30:01 +07:00
Denozordec fba3302079 Update reverse proxy tests to use absolute URLs for requests. Modified reverse_test.go to ensure that requests are constructed with the server's URL, preventing issues with the default "example.com" host in httptest. This change enhances the reliability of the tests by ensuring correct request handling.
Publish telemt-api gateway Docker image / test (push) Failing after 26s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
2026-03-30 00:27:44 +07:00
Denozordec 4f91c7227e Clear RequestURI in reverse proxy to prevent client RoundTrip rejection. Updated reverse.go to ensure that server-side requests do not carry RequestURI, enhancing compatibility with client requests.
Publish telemt-api gateway Docker image / test (push) Failing after 27s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
2026-03-30 00:24:34 +07:00
Denozordec 5a9b402220 Refactor reverse proxy path handling and enhance documentation. Updated reverse.go to improve upstream URL construction and added a new test for nested API routes in reverse_test.go. Revised GATEWAY_RUN.md to clarify API path behavior and configuration requirements for Nginx. Adjusted comments in config.example.yaml for better understanding of HTTPS and API prefix usage.
Publish telemt-api gateway Docker image / test (push) Failing after 36s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped
2026-03-30 00:21:16 +07:00
Denozordec 16b1d8148d Refactor reverse proxy to support API base path and update example configuration. Changed base URLs in config.example.yaml to use HTTPS and the new /api/ prefix. Enhanced reverse proxy logic in reverse.go to build upstream paths correctly and added a new test for path rewriting with the API base path in reverse_test.go.
Publish telemt-api gateway Docker image / test (push) Successful in 32s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 1m40s
2026-03-30 00:04:45 +07:00
Denozordec 91f289c647 Init
ci / test (push) Successful in 1m15s
ci / docker (push) Successful in 1m8s
2026-03-29 22:51:02 +07:00