starpc 0.32.2 → 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,6 +2,12 @@ module github.com/aperturerobotics/starpc
2
2
 
3
3
  go 1.22
4
4
 
5
+ // Optional: this fork uses go-protobuf-lite.
6
+ replace github.com/libp2p/go-libp2p => github.com/aperturerobotics/go-libp2p v0.33.1-0.20240504075939-591fc65373be // aperture
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
+
5
11
  require (
6
12
  github.com/aperturerobotics/protobuf-go-lite v0.6.1 // latest
7
13
  github.com/aperturerobotics/util v1.23.0 // latest
@@ -11,7 +17,7 @@ require (
11
17
  github.com/libp2p/go-libp2p v0.33.2 // latest
12
18
  github.com/libp2p/go-yamux/v4 v4.0.2-0.20240322071716-53ef5820bd48 // master
13
19
  github.com/sirupsen/logrus v1.9.3 // latest
14
- google.golang.org/protobuf v1.33.0 // latest
20
+ google.golang.org/protobuf v1.34.0 // latest
15
21
  nhooyr.io/websocket v1.8.11 // latest
16
22
  )
17
23
 
package/go.sum CHANGED
@@ -1,3 +1,5 @@
1
+ github.com/aperturerobotics/go-libp2p v0.33.1-0.20240504075939-591fc65373be h1:PZi7dbdjWqHa0TE1lD0f5WxzshL/qPp9fZ1K55fGo1c=
2
+ github.com/aperturerobotics/go-libp2p v0.33.1-0.20240504075939-591fc65373be/go.mod h1:gA6iEEVpQcx0xpygG/U0wkm+DfII4zoPc3EWViXC5b0=
1
3
  github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+GUjVvFJN+D3w1VOqqHRI=
2
4
  github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
3
5
  github.com/aperturerobotics/protobuf-go-lite v0.6.1 h1:dN4baS2e2qHhdpX57RJKUEukseXrXtqtiUJxGFFUbRs=
@@ -19,8 +21,6 @@ github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuV
19
21
  github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
20
22
  github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
21
23
  github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg=
22
- github.com/libp2p/go-libp2p v0.33.2 h1:vCdwnFxoGOXMKmaGHlDSnL4bM3fQeW8pgIa9DECnb40=
23
- github.com/libp2p/go-libp2p v0.33.2/go.mod h1:zTeppLuCvUIkT118pFVzA8xzP/p2dJYOMApCkFh0Yww=
24
24
  github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
25
25
  github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg=
26
26
  github.com/libp2p/go-yamux/v4 v4.0.2-0.20240322071716-53ef5820bd48 h1:KI65sCCL2h9IyCQwBhBXDgkKt3bmXoTu8T3rLVLZW4I=
@@ -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,13 +67,11 @@ 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
+ google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4=
71
+ google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
70
72
  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
71
73
  gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
72
74
  gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
73
75
  gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
74
76
  lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
75
77
  lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
76
- nhooyr.io/websocket v1.8.11 h1:f/qXNc2/3DpoSZkHt1DQu6rj4zGC8JmkkLkWss0MgN0=
77
- 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.2",
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) {}