Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
Framework to build my own websocket subprotocols and implement client and server

I'm looking for a framework (preferably for Python or JavaScript) that allows me to create my own websocket subprotocols and create servers and clients that will communicate using them.

The subprotocol I'm dealing with is based on JSON and has specific requests and responses, and I already defined their schemas (this cannot be altered). So I was hoping to find any tool in which I can just define the Schemas and tell server and client to use them, otherwise I'll have to implement websocket from scratch.

I've tried Flask and even considered changing its source code, but didn't find anything related to subprotocols in it. I guess its made to stick to the default configurations on that.

Same thing on JS's WebSocket built-in module. Apparently (as I read here), you can specify subprotocols in the client connection but not define them.

I also found this article explaining how to implement websocket from scratch and possibly include custom subprotocols, but this solution is what I'm running from since I don't intend to reinvent the wheel here.

For what it's worth, I'm sharing below a part of the subprotocol I have. This is the complete JSON Schema for a specific request sent by the client. I have these for all the requests and responses I'll need, from both client and server. Unfortunately I can't share everything:

{
   "$schema": "http://json-schema.org/draft-06/schema#",
   "comment": "subprotocol_name",
   "type": "object",
   "properties": {
      "type": {
         "type": "string",
         "enum": [
            "request"
         ]
      },
      "kind": {
         "type": "string",
         "enum": [
            "configuration"
         ]
      },
      "sequenceNumber": {
         "$ref": "#/definitions/sequenceNumber"
      },
      "payload": {
      }
   },
   "required": [
      "type",
      "kind",
      "sequenceNumber",
      "payload"
   ],
   "definitions": {
      "sequenceNumber": {
         "type": "integer",
         "minimum": 0,
         "maximum": 2147483647
      }
   }
}

If there's any solution to my problem, I'd like to know if this would be enough to define the subprotocol.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda