Skip to content

rmove DNS out of rama-tcp #841

@GlenDC

Description

@GlenDC

Instead of handling DNS resolution implicitly, we should provide a dedicated connector service backed by a DNS provider.

Together with the work in #840, this would make connectors such as TcpConnector much simpler and more composable.

The idea is that connectors are stacked, each with a single responsibility:

... other connectors
|
ProxyTargetConnector
  Uses the proxy target if present as the connection target
|
DnsAddressResolverConnector
  Resolves the target if it is a domain name
|
TcpConnector
  Only accepts a socket address (or something convertible to it).
  If the target is still a domain name, it should fail.

This keeps each connector simple and explicit.

Benefits

  • Clear separation of responsibilities between connectors
  • Simpler connectors such as TcpConnector
  • More flexible connector stacks
  • Enables deeper control over the DNS stack in the future (for example allowing rama-dns to rely on rama-tcp)

Implications

For higher level utilities such as EasyHttpWebClient, the stack builder can inject the required connectors automatically depending on the needs.

This approach also avoids leaking connection related data through extensions.

Extensions

We should stop inserting ProxyAddress into extensions.

Instead we should inject:

  • ProxyTarget
  • ProxyCredentials

ProxyAddress can still exist as a type, but it would no longer have a Rama defined meaning inside extensions and would not be injected automatically. Users can still insert it themselves if they want.

Metadata

Metadata

Assignees

Labels

Core TeamTicket reserved for Core TeamenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions