diff --git a/pkg/impl/signal-server/signaling.go b/pkg/impl/signal-server/signaling.go index 37a9e4d..f56e662 100644 --- a/pkg/impl/signal-server/signaling.go +++ b/pkg/impl/signal-server/signaling.go @@ -54,23 +54,26 @@ func (signalingServer SignalingServer) handleStream(ctx context.Context, errGrou return nil } else if err == nil { switch innerMsg := msg.Message.(type) { + case *proto.SignalingMessage_Bootstrap: + errGroup.Go(signalingServer.handleRedisPubSub(ctx, msg.Sender, msg.Room, stream)) case *proto.SignalingMessage_DiscoverRequest: // ignore msg.Receiver, from sender to whole channel if received, err := signalingServer.redis.Publish(ctx, signalingServer.redisKeyPrefix+":"+msg.Room+":discover", msg.Sender).Result(); err != nil { return err } else { - log.Printf("peers received discover request: %v", received) + log.Printf("peers received discover request %v -> %v(all): %v", msg.Sender, msg.Room, received) } - errGroup.Go(signalingServer.handleRedisPubSub(ctx, msg.Sender, msg.Room, stream)) case *proto.SignalingMessage_DiscoverResponse: if received, err := signalingServer.redis.Publish(ctx, signalingServer.redisKeyPrefix+":"+msg.Room+":discover:"+*msg.Receiver, msg.Sender).Result(); err != nil { return err } else { - log.Printf("peers received discover response: %v", received) + log.Printf("peers received discover response %v -> %v(%v): %v", msg.Sender, msg.Room, *msg.Receiver, received) } case *proto.SignalingMessage_SessionOffer: payload := &bytes.Buffer{} - json.NewEncoder(payload).Encode(innerMsg.SessionOffer) + if err := json.NewEncoder(payload).Encode(innerMsg.SessionOffer); err != nil { + return err + } if received, err := signalingServer.redis.Publish(ctx, signalingServer.redisKeyPrefix+":"+msg.Room+":offer:"+*msg.Receiver, payload.String()).Result(); err != nil { return err @@ -79,7 +82,9 @@ func (signalingServer SignalingServer) handleStream(ctx context.Context, errGrou } case *proto.SignalingMessage_SessionAnswer: payload := &bytes.Buffer{} - json.NewEncoder(payload).Encode(innerMsg.SessionAnswer) + if err := json.NewEncoder(payload).Encode(innerMsg.SessionAnswer); err != nil { + return err + } if received, err := signalingServer.redis.Publish(ctx, signalingServer.redisKeyPrefix+":"+msg.Room+":answer:"+*msg.Receiver, payload.String()).Result(); err != nil { return err @@ -102,48 +107,69 @@ func (signalingServer SignalingServer) handleRedisPubSub(ctx context.Context, na signalingServer.redisKeyPrefix+":"+room+":offer:"+name, signalingServer.redisKeyPrefix+":"+room+":answer:"+name, ) + defer pubsub.Unsubscribe(ctx) defer pubsub.Close() + if err := stream.Send(&proto.SignalingMessage{ + Room: room, + Sender: name, + Message: &proto.SignalingMessage_Bootstrap{}, + }); err != nil { + return err + } + ch := pubsub.Channel() for msg := range ch { switch msg.Channel { case signalingServer.redisKeyPrefix + ":" + room + ":discover": - stream.Send(&proto.SignalingMessage{ + if err := stream.Send(&proto.SignalingMessage{ Room: room, - Sender: name, + Sender: msg.Payload, Message: &proto.SignalingMessage_DiscoverRequest{}, - }) + }); err != nil { + return err + } case signalingServer.redisKeyPrefix + ":" + room + ":discover:" + name: - stream.Send(&proto.SignalingMessage{ + if err := stream.Send(&proto.SignalingMessage{ Room: room, - Sender: name, - Receiver: &msg.Payload, + Sender: msg.Payload, + Receiver: &name, Message: &proto.SignalingMessage_DiscoverResponse{}, - }) + }); err != nil { + return err + } case signalingServer.redisKeyPrefix + ":" + room + ":offer:" + name: sdpMessage := &proto.SDPMessage{} - json.NewDecoder(strings.NewReader(msg.Payload)).Decode(sdpMessage) + if err := json.NewDecoder(strings.NewReader(msg.Payload)).Decode(sdpMessage); err != nil { + return err + } - stream.Send(&proto.SignalingMessage{ + if err := stream.Send(&proto.SignalingMessage{ Room: room, - Sender: name, - Receiver: &msg.Payload, + Sender: sdpMessage.Sender, + Receiver: &name, Message: &proto.SignalingMessage_SessionOffer{ SessionOffer: sdpMessage, }, - }) + }); err != nil { + return err + } case signalingServer.redisKeyPrefix + ":" + room + ":answer:" + name: sdpMessage := &proto.SDPMessage{} - json.NewDecoder(strings.NewReader(msg.Payload)).Decode(sdpMessage) + if err := json.NewDecoder(strings.NewReader(msg.Payload)).Decode(sdpMessage); err != nil { + return err + } - stream.Send(&proto.SignalingMessage{ + if err := stream.Send(&proto.SignalingMessage{ Room: room, - Sender: name, - Receiver: &msg.Payload, - Message: &proto.SignalingMessage_SessionOffer{ - SessionOffer: sdpMessage, + Sender: sdpMessage.Sender, + Receiver: &name, + Message: &proto.SignalingMessage_SessionAnswer{ + SessionAnswer: sdpMessage, }, - }) + }); err != nil { + return err + } } } diff --git a/pkg/proto/signal-server/signaling.pb.go b/pkg/proto/signal-server/signaling.pb.go index 82701f7..d191719 100644 --- a/pkg/proto/signal-server/signaling.pb.go +++ b/pkg/proto/signal-server/signaling.pb.go @@ -146,6 +146,7 @@ type SignalingMessage struct { Receiver *string `protobuf:"bytes,3,opt,name=Receiver,proto3,oneof" json:"Receiver,omitempty"` // Types that are assignable to Message: // + // *SignalingMessage_Bootstrap // *SignalingMessage_DiscoverRequest // *SignalingMessage_DiscoverResponse // *SignalingMessage_SessionOffer @@ -213,6 +214,13 @@ func (m *SignalingMessage) GetMessage() isSignalingMessage_Message { return nil } +func (x *SignalingMessage) GetBootstrap() *emptypb.Empty { + if x, ok := x.GetMessage().(*SignalingMessage_Bootstrap); ok { + return x.Bootstrap + } + return nil +} + func (x *SignalingMessage) GetDiscoverRequest() *emptypb.Empty { if x, ok := x.GetMessage().(*SignalingMessage_DiscoverRequest); ok { return x.DiscoverRequest @@ -245,22 +253,28 @@ type isSignalingMessage_Message interface { isSignalingMessage_Message() } +type SignalingMessage_Bootstrap struct { + Bootstrap *emptypb.Empty `protobuf:"bytes,10,opt,name=Bootstrap,proto3,oneof"` +} + type SignalingMessage_DiscoverRequest struct { - DiscoverRequest *emptypb.Empty `protobuf:"bytes,10,opt,name=DiscoverRequest,proto3,oneof"` + DiscoverRequest *emptypb.Empty `protobuf:"bytes,11,opt,name=DiscoverRequest,proto3,oneof"` } type SignalingMessage_DiscoverResponse struct { - DiscoverResponse *emptypb.Empty `protobuf:"bytes,11,opt,name=DiscoverResponse,proto3,oneof"` + DiscoverResponse *emptypb.Empty `protobuf:"bytes,12,opt,name=DiscoverResponse,proto3,oneof"` } type SignalingMessage_SessionOffer struct { - SessionOffer *SDPMessage `protobuf:"bytes,12,opt,name=SessionOffer,proto3,oneof"` + SessionOffer *SDPMessage `protobuf:"bytes,13,opt,name=SessionOffer,proto3,oneof"` } type SignalingMessage_SessionAnswer struct { - SessionAnswer *SDPMessage `protobuf:"bytes,13,opt,name=SessionAnswer,proto3,oneof"` + SessionAnswer *SDPMessage `protobuf:"bytes,14,opt,name=SessionAnswer,proto3,oneof"` } +func (*SignalingMessage_Bootstrap) isSignalingMessage_Message() {} + func (*SignalingMessage_DiscoverRequest) isSignalingMessage_Message() {} func (*SignalingMessage_DiscoverResponse) isSignalingMessage_Message() {} @@ -280,44 +294,48 @@ var file_signaling_proto_rawDesc = []byte{ 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x53, 0x44, 0x50, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0xe9, 0x02, 0x0a, 0x10, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0xa1, 0x03, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, - 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, - 0x0f, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, - 0x52, 0x0f, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x44, 0x0a, 0x10, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x10, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x53, 0x44, 0x50, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x0d, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x44, 0x50, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, - 0x52, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x42, - 0x09, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x2a, 0x40, 0x0a, 0x0e, 0x53, 0x44, 0x50, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x69, 0x64, - 0x65, 0x6f, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x10, 0x01, 0x12, - 0x0e, 0x0a, 0x0a, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x10, 0x02, 0x12, - 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x10, 0x03, 0x32, 0x40, 0x0a, 0x09, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x12, 0x11, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x11, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x56, 0x5a, 0x54, 0x67, - 0x69, 0x74, 0x2e, 0x6a, 0x65, 0x66, 0x66, 0x74, 0x68, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, - 0x78, 0x79, 0x7a, 0x2f, 0x67, 0x75, 0x6f, 0x63, 0x68, 0x61, 0x6f, 0x2f, 0x6d, 0x65, 0x6f, 0x77, - 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x2e, 0x6a, 0x65, 0x66, 0x66, 0x74, - 0x68, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x2d, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, + 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x09, 0x42, 0x6f, 0x6f, 0x74, + 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x42, 0x0a, 0x0f, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0f, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x10, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x10, 0x44, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x44, 0x50, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x66, + 0x65, 0x72, 0x12, 0x33, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x73, + 0x77, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x44, 0x50, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x2a, + 0x40, 0x0a, 0x0e, 0x53, 0x44, 0x50, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, + 0x41, 0x75, 0x64, 0x69, 0x6f, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x41, 0x75, 0x64, 0x69, 0x6f, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x10, + 0x03, 0x32, 0x40, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x33, + 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x11, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x11, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, + 0x01, 0x30, 0x01, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x2e, 0x6a, 0x65, 0x66, 0x66, 0x74, + 0x68, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x2f, 0x67, 0x75, 0x6f, 0x63, + 0x68, 0x61, 0x6f, 0x2f, 0x6d, 0x65, 0x6f, 0x77, 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x69, + 0x6e, 0x67, 0x2e, 0x6a, 0x65, 0x66, 0x66, 0x74, 0x68, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, + 0x78, 0x79, 0x7a, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -342,17 +360,18 @@ var file_signaling_proto_goTypes = []interface{}{ } var file_signaling_proto_depIdxs = []int32{ 0, // 0: SDPMessage.Type:type_name -> SDPMessageType - 3, // 1: SignalingMessage.DiscoverRequest:type_name -> google.protobuf.Empty - 3, // 2: SignalingMessage.DiscoverResponse:type_name -> google.protobuf.Empty - 1, // 3: SignalingMessage.SessionOffer:type_name -> SDPMessage - 1, // 4: SignalingMessage.SessionAnswer:type_name -> SDPMessage - 2, // 5: Signaling.Connect:input_type -> SignalingMessage - 2, // 6: Signaling.Connect:output_type -> SignalingMessage - 6, // [6:7] is the sub-list for method output_type - 5, // [5:6] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 3, // 1: SignalingMessage.Bootstrap:type_name -> google.protobuf.Empty + 3, // 2: SignalingMessage.DiscoverRequest:type_name -> google.protobuf.Empty + 3, // 3: SignalingMessage.DiscoverResponse:type_name -> google.protobuf.Empty + 1, // 4: SignalingMessage.SessionOffer:type_name -> SDPMessage + 1, // 5: SignalingMessage.SessionAnswer:type_name -> SDPMessage + 2, // 6: Signaling.Connect:input_type -> SignalingMessage + 2, // 7: Signaling.Connect:output_type -> SignalingMessage + 7, // [7:8] is the sub-list for method output_type + 6, // [6:7] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_signaling_proto_init() } @@ -387,6 +406,7 @@ func file_signaling_proto_init() { } } file_signaling_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*SignalingMessage_Bootstrap)(nil), (*SignalingMessage_DiscoverRequest)(nil), (*SignalingMessage_DiscoverResponse)(nil), (*SignalingMessage_SessionOffer)(nil), diff --git a/pkg/proto/signal-server/signaling.proto b/pkg/proto/signal-server/signaling.proto index 24dfd26..16669b4 100644 --- a/pkg/proto/signal-server/signaling.proto +++ b/pkg/proto/signal-server/signaling.proto @@ -22,11 +22,12 @@ message SignalingMessage { string Sender = 2; optional string Receiver = 3; oneof Message { - google.protobuf.Empty DiscoverRequest = 10; - google.protobuf.Empty DiscoverResponse = 11; + google.protobuf.Empty Bootstrap = 10; + google.protobuf.Empty DiscoverRequest = 11; + google.protobuf.Empty DiscoverResponse = 12; - SDPMessage SessionOffer = 12; - SDPMessage SessionAnswer = 13; + SDPMessage SessionOffer = 13; + SDPMessage SessionAnswer = 14; }; }