|
3 | 3 |
|
4 | 4 | from localstack_extensions.utils.docker import ProxiedDockerContainerExtension |
5 | 5 | from localstack import config |
| 6 | +from localstack.extensions.api import http |
6 | 7 |
|
7 | 8 | # Environment variables for configuration |
8 | 9 | ENV_POSTGRES_USER = "PARADEDB_POSTGRES_USER" |
@@ -56,22 +57,21 @@ def _tcp_health_check(): |
56 | 57 | tcp_ports=[postgres_port], # Enable TCP proxying through gateway |
57 | 58 | ) |
58 | 59 |
|
59 | | - # TODO: uncomment |
60 | | - # def update_gateway_routes(self, router: http.Router[http.RouteHandler]): |
61 | | - # """ |
62 | | - # Override to set up only TCP routing without HTTP proxy. |
63 | | - # |
64 | | - # ParadeDB uses the native PostgreSQL wire protocol (not HTTP), so we |
65 | | - # only need TCP protocol routing - not HTTP proxying. Adding an HTTP |
66 | | - # proxy without a host restriction would cause all HTTP requests to be |
67 | | - # forwarded to the PostgreSQL container, breaking other services. |
68 | | - # """ |
69 | | - # # Start the container |
70 | | - # self.start_container() |
71 | | - # |
72 | | - # # Set up only TCP protocol routing (skip HTTP proxy from base class) |
73 | | - # if self.tcp_ports: |
74 | | - # self._setup_tcp_protocol_routing() |
| 60 | + def update_gateway_routes(self, router: http.Router[http.RouteHandler]): |
| 61 | + """ |
| 62 | + Override to set up only TCP routing without HTTP proxy. |
| 63 | +
|
| 64 | + ParadeDB uses the native PostgreSQL wire protocol (not HTTP), so we |
| 65 | + only need TCP protocol routing - not HTTP proxying. Adding an HTTP |
| 66 | + proxy without a host restriction would cause all HTTP requests to be |
| 67 | + forwarded to the PostgreSQL container, breaking other services. |
| 68 | + """ |
| 69 | + # Start the container |
| 70 | + self.start_container() |
| 71 | + |
| 72 | + # Set up only TCP protocol routing (skip HTTP proxy from base class) |
| 73 | + if self.tcp_ports: |
| 74 | + self._setup_tcp_protocol_routing() |
75 | 75 |
|
76 | 76 | def tcp_connection_matcher(self, data: bytes) -> bool: |
77 | 77 | """ |
|
0 commit comments