Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ func dialConfig(conf *websocket.Config) (conn *websocket.Conn, err error) {
var c net.Conn

if useTLS {
tlsc := new(tls.Config)
var tlsc *tls.Config
if conf.TlsConfig != nil {
*tlsc = *conf.TlsConfig
tlsc = conf.TlsConfig.Clone()
} else {
tlsc = new(tls.Config)
}
tlsc.ServerName = serverName
c, err = tls.Dial("tcp", addr, tlsc)
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/farsightsec/sielink

go 1.19
go 1.23.0

toolchain go1.24.6

require (
github.com/golang/protobuf v1.5.3
golang.org/x/net v0.17.0
golang.org/x/net v0.43.0
google.golang.org/protobuf v1.36.8
)

require google.golang.org/protobuf v1.31.0 // indirect
13 changes: 4 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
2 changes: 1 addition & 1 deletion rawlink/confmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
package rawlink

import (
"github.com/golang/protobuf/proto"
"github.com/farsightsec/sielink"
"google.golang.org/protobuf/proto"
)

func (l *Link) setHeartbeat(hbtime uint32) {
Expand Down
1 change: 0 additions & 1 deletion rawlink/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// Package rawlink implements the base sielink Link protocol. It is not intended
// to be used directly, but different usage profiles of the Link protocol may embed
// a Link instance and implement their operations on top of it.
//
package rawlink

import (
Expand Down
2 changes: 1 addition & 1 deletion rawlink/link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"testing"
"time"

"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"

"github.com/farsightsec/sielink"
"github.com/farsightsec/sielink/rawlink"
Expand Down
4 changes: 2 additions & 2 deletions rawlink/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
package rawlink

import (
"github.com/golang/protobuf/proto"
"golang.org/x/net/websocket"
"github.com/farsightsec/sielink"
"golang.org/x/net/websocket"
"google.golang.org/protobuf/proto"
)

func readMessage(c *websocket.Conn, m *sielink.Message) error {
Expand Down
5 changes: 2 additions & 3 deletions rawlink/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"fmt"
"time"

"golang.org/x/net/websocket"
"github.com/farsightsec/sielink"
"golang.org/x/net/websocket"
)

type recoverError struct{ rerr interface{} }
type recoverError struct{ rerr any }

func (r recoverError) Error() string {
return fmt.Sprintf("panic: %v", r.rerr)
Expand All @@ -27,7 +27,6 @@ func (r recoverError) Error() string {
// It returns when it enocunters a read error (which it returns), receives a
// fatal Alert from its peer (which it returns), or receives a Finished message
// from its peer, in which case it returns nil.
//
func (l *Link) runReader(c *websocket.Conn, rshut chan<- struct{}) (err error) {
defer func() {
// The l.ControlFunc call needs to be in this closure for
Expand Down
4 changes: 2 additions & 2 deletions rawlink/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ package rawlink
import (
"time"

"github.com/golang/protobuf/proto"
"golang.org/x/net/websocket"
"github.com/farsightsec/sielink"
"golang.org/x/net/websocket"
"google.golang.org/protobuf/proto"
)

func sendHeartbeat(c *websocket.Conn, d time.Duration) {
Expand Down
2 changes: 1 addition & 1 deletion rawlink/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"fmt"
"time"

"golang.org/x/net/websocket"
"github.com/farsightsec/sielink"
"golang.org/x/net/websocket"
)

func (l *Link) runConnection(c *websocket.Conn) (err error) {
Expand Down
4 changes: 2 additions & 2 deletions sielink.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package sielink
import (
"fmt"

"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
)

// ProtocolVersion is the version of the protocol implemented
Expand All @@ -22,7 +22,7 @@ var ProtocolVersion uint32 = 1
// the package can interoperate with.
var SupportedVersions = []uint32{ProtocolVersion}

//go:generate protoc --go_out=. sielink.proto
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go_opt=Msielink.proto=github.com/farsightsec/sielink ./sielink.proto

// A Link is the basic interface to a collection of sielink connections.
type Link interface {
Expand Down
Loading