starpc 0.32.3 → 0.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/go.mod CHANGED
@@ -2,9 +2,12 @@ module github.com/aperturerobotics/starpc
2
2
 
3
3
  go 1.22
4
4
 
5
- // While not absolutely necessary, this fork uses go-protobuf-lite.
5
+ // Optional: this fork uses go-protobuf-lite.
6
6
  replace github.com/libp2p/go-libp2p => github.com/aperturerobotics/go-libp2p v0.33.1-0.20240504075939-591fc65373be // aperture
7
7
 
8
+ // Optional: this fork avoids importing net/http on wasm.
9
+ replace nhooyr.io/websocket => github.com/paralin/nhooyr-websocket v1.8.12-0.20240504231911-2358de657064 // aperture-1
10
+
8
11
  require (
9
12
  github.com/aperturerobotics/protobuf-go-lite v0.6.1 // latest
10
13
  github.com/aperturerobotics/util v1.23.0 // latest
package/go.sum CHANGED
@@ -45,6 +45,8 @@ github.com/multiformats/go-multistream v0.5.0 h1:5htLSLl7lvJk3xx3qT/8Zm9J4K8vEOf
45
45
  github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dydlEqV3l6N3/GBsX6ILA=
46
46
  github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8=
47
47
  github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
48
+ github.com/paralin/nhooyr-websocket v1.8.12-0.20240504231911-2358de657064 h1:JV7i3sVQ6S4YhpBmTTPuRVH9WUM1xmqApX4Ffb5rOZQ=
49
+ github.com/paralin/nhooyr-websocket v1.8.12-0.20240504231911-2358de657064/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
48
50
  github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
49
51
  github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
50
52
  github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -65,8 +67,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
65
67
  golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
66
68
  golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
67
69
  golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
68
- google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
69
- google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
70
70
  google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4=
71
71
  google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
72
72
  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -75,5 +75,3 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
75
75
  gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
76
76
  lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
77
77
  lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
78
- nhooyr.io/websocket v1.8.11 h1:f/qXNc2/3DpoSZkHt1DQu6rj4zGC8JmkkLkWss0MgN0=
79
- nhooyr.io/websocket v1.8.11/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.32.3",
3
+ "version": "0.32.4",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -92,7 +92,7 @@
92
92
  "pre-commit": "^1.2.2",
93
93
  "prettier": "^3.2.4",
94
94
  "rimraf": "^5.0.1",
95
- "tsx": "^4.8.2",
95
+ "tsx": "^4.9.1",
96
96
  "typescript": "^5.3.2"
97
97
  },
98
98
  "dependencies": {
@@ -1,3 +1,5 @@
1
+ //go:build !js
2
+
1
3
  package srpc
2
4
 
3
5
  import (
@@ -8,7 +10,9 @@ import (
8
10
  "nhooyr.io/websocket"
9
11
  )
10
12
 
11
- // HTTPServer implements the SRPC server.
13
+ // HTTPServer implements the SRPC HTTP/WebSocket server.
14
+ //
15
+ // NOTE: accepting websocket connections is stubbed out on GOOS=js!
12
16
  type HTTPServer struct {
13
17
  mux Mux
14
18
  srpc *Server
@@ -0,0 +1,18 @@
1
+ //go:build js
2
+
3
+ package srpc
4
+
5
+ import "errors"
6
+
7
+ // HTTPServer implements the SRPC HTTP/WebSocket server.
8
+ //
9
+ // NOTE: accepting websocket connections is stubbed out on GOOS=js!
10
+ type HTTPServer struct{}
11
+
12
+ // NewHTTPServer builds a http server / handler.
13
+ func NewHTTPServer(mux Mux, path string) (*HTTPServer, error) {
14
+ return nil, errors.New("srpc: http server not implemented on js")
15
+ }
16
+
17
+ // stub for js
18
+ func (s *HTTPServer) ServeHTTP(w any, r any) {}