mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-05-29 16:39:45 +00:00
refactor: fix revive exported return and Run comment
This commit is contained in:
@@ -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{}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user