Creates a service that forwards traffic to a specified address via the host. Parameters ---------- ports: Ports to expose via the service, forwarding through the host network. If a port's frontend is unspecified or 0, it defaults t
(
self,
ports: list[PortForward],
*,
host: str | None = "localhost",
)
| 10142 | return await _ctx.execute(str) |
| 10143 | |
| 10144 | def service( |
| 10145 | self, |
| 10146 | ports: list[PortForward], |
| 10147 | *, |
| 10148 | host: str | None = "localhost", |
| 10149 | ) -> "Service": |
| 10150 | """Creates a service that forwards traffic to a specified address via the |
| 10151 | host. |
| 10152 | |
| 10153 | Parameters |
| 10154 | ---------- |
| 10155 | ports: |
| 10156 | Ports to expose via the service, forwarding through the host |
| 10157 | network. |
| 10158 | If a port's frontend is unspecified or 0, it defaults to the same |
| 10159 | as the backend port. |
| 10160 | An empty set of ports is not valid; an error will be returned. |
| 10161 | host: |
| 10162 | Upstream host to forward traffic to. |
| 10163 | """ |
| 10164 | _args = [ |
| 10165 | Arg("ports", ports), |
| 10166 | Arg("host", host, "localhost"), |
| 10167 | ] |
| 10168 | _ctx = self._select("service", _args) |
| 10169 | return Service(_ctx) |
| 10170 | |
| 10171 | def tunnel( |
| 10172 | self, |