Hi all,
I was playing around with this nice package. But needed to dig deep to come to the conclusion the hostType private interface is a single function private interface where the public caller needs to implement
https://github.com/cloudfoundry/socks5-proxy/blob/main/socks5_proxy.go#L22
When I want to extend my CLI tool with SSHFP (ssh DNS host fingerprint) functionality it is not clear. When using this package it is not 100% clear what needs to be passed to the NewSocks5Proxy hostKey parameter. I hacked my CLI tool with a custom Get function and cache the fetched host key. Which is almost the same implementation as the public HostKey type.
UPDATE: It is simpler than I thought with the following code to use the standard mechanism. But this doesn't allow custom host key handling.
hostKey := proxy.NewHostKey()
sshSocks5Proxy := proxy.NewSocks5Proxy(&hostKey, nil, time.Minute)
The package I want to integrate is https://github.com/xor-gate/sshfp so the host key can be trusted using a SSHFP DNS record.
Hopefully this is clear enough, or else please ask.
Long story short: Why is the interface of hostKey type private?
Hi all,
I was playing around with this nice package. But needed to dig deep to come to the conclusion the
hostTypeprivate interface is a single function private interface where the public caller needs to implementhttps://github.com/cloudfoundry/socks5-proxy/blob/main/socks5_proxy.go#L22
When I want to extend my CLI tool with SSHFP (ssh DNS host fingerprint) functionality it is not clear. When using this package it is not 100% clear what needs to be passed to the
NewSocks5ProxyhostKeyparameter. I hacked my CLI tool with a custom Get function and cache the fetched host key. Which is almost the same implementation as the publicHostKeytype.UPDATE: It is simpler than I thought with the following code to use the standard mechanism. But this doesn't allow custom host key handling.
The package I want to integrate is https://github.com/xor-gate/sshfp so the host key can be trusted using a SSHFP DNS record.
Hopefully this is clear enough, or else please ask.
Long story short: Why is the interface of hostKey type private?