refactor: fix revive exported return and Run comment

This commit is contained in:
zarazaex69
2026-04-12 23:34:06 +03:00
parent e153ad2cb0
commit b89fdd45cc
2 changed files with 13 additions and 8 deletions

View File

@@ -62,10 +62,10 @@ func DialContext(ctx context.Context, network, address string) (net.Conn, error)
return conn, nil
}
// proxyDialer implements golang.org/x/net/proxy.Dialer for pion ICE.
type proxyDialer struct{}
// ProxyDialer implements golang.org/x/net/proxy.Dialer for pion ICE.
type ProxyDialer struct{}
func (d *proxyDialer) Dial(network, addr string) (net.Conn, error) {
func (d *ProxyDialer) Dial(network, addr string) (net.Conn, error) {
conn, err := NewDialer().Dial(network, addr)
if err != nil {
return nil, fmt.Errorf("dial failed: %w", err)
@@ -74,6 +74,7 @@ func (d *proxyDialer) Dial(network, addr string) (net.Conn, error) {
}
// NewProxyDialer returns a proxy.Dialer that protects ICE sockets.
func NewProxyDialer() *proxyDialer {
return &proxyDialer{}
func NewProxyDialer() *ProxyDialer {
return &ProxyDialer{}
}

View File

@@ -57,12 +57,16 @@ type ConnectRequest struct { //nolint:revive
Port int `json:"port"`
}
// Run starts the olcrtc server and listens for client connections.
func Run(
ctx context.Context,
roomURL, keyHex string,
dnsServer, socksProxyAddr string,
roomURL,
keyHex string,
dnsServer,
socksProxyAddr string,
socksProxyPort int,
) error { //nolint:revive
) error {
runCtx, cancel := context.WithCancel(ctx)
defer cancel()