New Fluxzy v2 just shipped. Electron is out, Tauri is in. gRPC ready, 3x smaller install. Learn more

forceRemotePortAction Action

Override the destination port Fluxzy connects to, while keeping the original host and path the client requested.

Hostnames are stable but ports often drift between environments. forceRemotePortAction keeps the client side URL exactly as it was and redirects only the TCP destination, which is usually the safest way to point traffic at a staging build or a side by side deployment.

When to use this action

Use forceRemotePortAction when you want to keep the original URL but redirect Fluxzy to a different port on the upstream. The Host header and SNI stay untouched, only the TCP destination port changes.

Typical situations include:

  • Routing production hostnames to a local debug build listening on port 8443.
  • Probing a staging instance that runs on a non standard port without touching the client code.
  • Comparing two versions of a service that are deployed on the same host but different ports.
  • Exercising a TLS endpoint that mirrors production but listens elsewhere.

The action runs on the onAuthorityReceived scope, before the TCP connection is opened. Combine with spoofDnsAction if you also need to change the host IP, not just the port.

Real world examples

Send production hostnames to a local debug port

Lets your client keep using https://api.internal.example.com while Fluxzy actually connects to port 8443 on the same host.

rules:
- filter:
    typeKind: HostFilter
    pattern: api.internal.example.com
  actions:
  - typeKind: ForceRemotePortAction
    port: 8443

Probe a staging endpoint that lives on a custom port

Combined with spoofDnsAction this is a powerful way to redirect a hostname to a completely different server.

rules:
- filter:
    typeKind: HostFilter
    pattern: payments.example.com
  actions:
  - typeKind: SpoofDnsAction
    remoteHostIp: 10.0.0.42
  - typeKind: ForceRemotePortAction
    port: 9443

Force port only for one path prefix

Useful when only part of an API lives on a different port during a migration.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HostFilter
      pattern: legacy.example.com
    - typeKind: PathFilter
      pattern: /v2/
  actions:
  - typeKind: ForceRemotePortAction
    port: 8444

Reference

forceRemotePortAction

Description

Ignores the default port used by the current authority and use the provided port instead.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

onAuthorityReceived This scope denotes the moment fluxzy is aware the destination authority. In a regular proxy connection, it will occur the moment where fluxzy parsed the CONNECT request.

YAML configuration name

forceRemotePortAction

Settings

The following table describes the customizable properties available for this action:

Property Type Description DefaultValue
port int32 The port to use for the remote connection 0

Example of usage

This filter has no specific usage example

.NET reference

View definition of ForceRemotePortAction for .NET integration.

See also

This action has no related action

Frequently asked questions

Does the client see the port change?

No. The original Host header and URL stay intact, so the client behaves as if it was talking to the default port.

What happens with TLS when I redirect to a different port?

Fluxzy still uses the original SNI from the request authority. The upstream certificate must be valid for that hostname or the handshake will fail (unless you use skipRemoteCertificateValidationAction).

Can I redirect HTTP and HTTPS traffic with the same rule?

Yes. The action only changes the TCP port. Whether the connection is TLS or not depends on the original request scheme.

How is this different from forwardAction?

forwardAction makes Fluxzy act as a reverse proxy and rewrites the host, scheme, and protocol. forceRemotePortAction only changes the port while keeping everything else as the client sent it.

Learn more about Fluxzy rules