{"id":17359059,"url":"https://github.com/zishang520/engine.io-server-go-fasthttp","last_synced_at":"2025-10-27T17:31:16.651Z","repository":{"id":239691087,"uuid":"799998235","full_name":"zishang520/engine.io-server-go-fasthttp","owner":"zishang520","description":"[Not ready] engine.io for golang fasthttp, Start your pleasant journey! 😀","archived":false,"fork":false,"pushed_at":"2024-07-10T14:37:18.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-19T23:16:08.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zishang520.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-13T14:03:40.000Z","updated_at":"2024-07-10T14:37:02.000Z","dependencies_parsed_at":"2024-07-10T17:14:44.459Z","dependency_job_id":null,"html_url":"https://github.com/zishang520/engine.io-server-go-fasthttp","commit_stats":null,"previous_names":["zishang520/engine.io-server-go-fasthttp"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-server-go-fasthttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-server-go-fasthttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-server-go-fasthttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-server-go-fasthttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zishang520","download_url":"https://codeload.github.com/zishang520/engine.io-server-go-fasthttp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238533290,"owners_count":19488159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T19:07:56.767Z","updated_at":"2025-10-27T17:31:16.645Z","avatar_url":"https://github.com/zishang520.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Engine.IO: the realtime engine for golang\n\n[![Build Status](https://github.com/zishang520/engine.io-server-go-fasthttp/workflows/Go/badge.svg?branch=main)](https://github.com/zishang520/engine.io-server-go-fasthttp/actions)\n[![GoDoc](https://pkg.go.dev/badge/github.com/zishang520/engine.io-server-go-fasthttp/v2?utm_source=godoc)](https://pkg.go.dev/github.com/zishang520/engine.io-server-go-fasthttp/v2)\n\n`Engine.IO` is the implementation of transport-based\ncross-browser/cross-device bi-directional communication layer for\n[Socket.IO for golang](http://github.com/zishang520/socket.io).\n\n## How to use (**Due to the update of related components, the project has been archived, please use https://github.com/zishang520/engine.io**)\n\n### Server\n\n#### (A) Listening on a port\n\n```golang\npackage main\n\nimport (\n    \"os\"\n    \"os/signal\"\n    \"strings\"\n    \"syscall\"\n\n    _types \"github.com/zishang520/engine.io-go-parser/types\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/config\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/types\"\n    \"github.com/zishang520/engine.io/v2/utils\"\n)\n\nfunc main() {\n    serverOptions := \u0026config.ServerOptions{}\n    serverOptions.SetAllowEIO3(true)\n    serverOptions.SetCors(\u0026types.Cors{\n        Origin:      \"*\",\n        Credentials: true,\n    })\n\n    engineServer := engine.Listen(\"127.0.0.1:4444\", serverOptions, nil)\n    engineServer.On(\"connection\", func(sockets ...any) {\n        socket := sockets[0].(engine.Socket)\n        socket.Send(strings.NewReader(\"utf 8 string\"), nil, nil)\n        socket.Send(_types.NewBytesBuffer([]byte{0, 1, 2, 3, 4, 5}), nil, nil)\n        socket.Send(_types.NewBytesBufferString(\"BufferString by string\"), nil, nil)\n        socket.Send(_types.NewStringBuffer([]byte(\"StringBuffer by byte\")), nil, nil)\n        socket.Send(_types.NewStringBufferString(\"StringBuffer by string\"), nil, nil)\n        socket.On(\"message\", func(...any) {\n            // socket.Send(strings.NewReader(\"utf 8 string\"), nil, nil)\n        })\n    })\n    utils.Log().Println(\"%v\", engineServer)\n\n    exit := make(chan struct{})\n    SignalC := make(chan os.Signal)\n\n    signal.Notify(SignalC, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n    go func() {\n        for s := range SignalC {\n            switch s {\n            case os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT:\n                close(exit)\n                return\n            }\n        }\n    }()\n\n    \u003c-exit\n    os.Exit(0)\n}\n\n```\n\n#### (B) Intercepting requests for a `*types.HttpServer`\n\n```golang\npackage main\n\nimport (\n    \"os\"\n    \"os/signal\"\n    \"syscall\"\n\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/config\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/types\"\n    \"github.com/zishang520/engine.io/v2/utils\"\n)\n\nfunc main() {\n    serverOptions := \u0026config.ServerOptions{}\n    serverOptions.SetAllowEIO3(true)\n    serverOptions.SetCors(\u0026types.Cors{\n        Origin:      \"*\",\n        Credentials: true,\n    })\n\n    httpServer := types.NewWebServer(nil)\n    httpServer.Listen(\"127.0.0.1:4444\", nil)\n\n    engineServer := engine.Attach(httpServer, serverOptions)\n\n    engineServer.On(\"connection\", func(sockets ...any) {\n        socket := sockets[0].(engine.Socket)\n        socket.On(\"message\", func(...any) {\n        })\n        socket.On(\"close\", func(...any) {\n            utils.Log().Println(\"client close.\")\n        })\n    })\n    utils.Log().Println(\"%v\", engineServer)\n\n    exit := make(chan struct{})\n    SignalC := make(chan os.Signal)\n\n    signal.Notify(SignalC, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n    go func() {\n        for s := range SignalC {\n            switch s {\n            case os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT:\n                close(exit)\n                return\n            }\n        }\n    }()\n\n    \u003c-exit\n    os.Exit(0)\n}\n```\n\n#### (C) Passing in requests\n\n```golang\npackage main\n\nimport (\n    \"os\"\n    \"os/signal\"\n    \"syscall\"\n\n    \"github.com/fasthttp/websocket\"\n    \"github.com/valyala/fasthttp\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/config\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/types\"\n    \"github.com/zishang520/engine.io/v2/utils\"\n)\n\nfunc main() {\n    serverOptions := \u0026config.ServerOptions{}\n    serverOptions.SetAllowEIO3(true)\n    serverOptions.SetCors(\u0026types.Cors{\n        Origin:      \"*\",\n        Credentials: true,\n    })\n\n    httpServer := types.NewWebServer(nil)\n    httpServer.Listen(\"127.0.0.1:4444\", nil)\n\n    engineServer := engine.New(serverOptions)\n\n    httpServer.HandleFunc(\"/\", func(ctx *fasthttp.RequestCtx) {\n        if !websocket.FastHTTPIsWebSocketUpgrade(ctx) {\n            utils.Log().Debug(`intercepting request for path \"%s\"`, utils.CleanPath(string(ctx.Path())))\n            engineServer.HandleRequest(types.NewHttpContext(ctx))\n        } else if engineServer.Opts().Transports().Has(\"websocket\") {\n            engineServer.HandleUpgrade(types.NewHttpContext(ctx))\n        } else {\n            httpServer.FastHTTP(ctx)\n        }\n    })\n\n    engineServer.On(\"connection\", func(sockets ...any) {\n        socket := sockets[0].(engine.Socket)\n        socket.On(\"message\", func(...any) {\n        })\n        socket.On(\"close\", func(...any) {\n            utils.Log().Println(\"client close.\")\n        })\n    })\n    utils.Log().Println(\"%v\", engineServer)\n\n    exit := make(chan struct{})\n    SignalC := make(chan os.Signal)\n\n    signal.Notify(SignalC, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n    go func() {\n        for s := range SignalC {\n            switch s {\n            case os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT:\n                close(exit)\n                return\n            }\n        }\n    }()\n\n    \u003c-exit\n    httpServer.Close(nil)\n    os.Exit(0)\n}\n\n```\n\n#### (D) Passing in requests (`types.Handler` interface)\n\n```golang\npackage main\n\nimport (\n    \"net/http\"\n    \"os\"\n    \"os/signal\"\n    \"syscall\"\n\n    \"github.com/valyala/fasthttp\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/config\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"\n    \"github.com/zishang520/engine.io-server-go-fasthttp/v2/types\"\n    \"github.com/zishang520/engine.io/v2/utils\"\n)\n\nfunc main() {\n    serverOptions := \u0026config.ServerOptions{}\n    serverOptions.SetAllowEIO3(true)\n    serverOptions.SetCors(\u0026types.Cors{\n        Origin:      \"*\",\n        Credentials: true,\n    })\n\n    engineServer := engine.New(serverOptions)\n\n    engineServer.On(\"connection\", func(sockets ...any) {\n        socket := sockets[0].(engine.Socket)\n        socket.On(\"message\", func(...any) {\n        })\n        socket.On(\"close\", func(...any) {\n            utils.Log().Println(\"client close.\")\n        })\n    })\n\n    go fasthttp.ListenAndServe(\":4444\", engineServer.FastHTTP)\n\n    utils.Log().Println(\"%v\", engineServer)\n\n    exit := make(chan struct{})\n    SignalC := make(chan os.Signal)\n\n    signal.Notify(SignalC, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n    go func() {\n        for s := range SignalC {\n            switch s {\n            case os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT:\n                close(exit)\n                return\n            }\n        }\n    }()\n\n    \u003c-exit\n\n    // Need to handle server shutdown disconnecting client connections.\n    engineServer.Close()\n    os.Exit(0)\n}\n```\n\n### Client\n\n```html\n\u003cscript src=\"engine.io.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const socket = new eio.Socket('ws://localhost:4444');\n  socket.on('open', () =\u003e {\n    socket.on('message', data =\u003e {});\n    socket.on('close', () =\u003e {});\n  });\n\u003c/script\u003e\n```\n\nFor more information on the client refer to the\n[engine-client](http://github.com/socketio/engine.io-client) repository.\n\n## What features does it have?\n\n- **Support engine-client 3+**\n\n## API\n\n### Server\n\n\u003chr\u003e\u003cbr\u003e\n\n#### Top-level\n\nThese are exposed by `import \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"`:\n\n##### Events\n\n- `flush`\n    - Called when a socket buffer is being flushed.\n    - **Arguments**\n      - `engine.Socket`: socket being flushed\n      - `[]*packet.Packet`: write buffer\n- `drain`\n    - Called when a socket buffer is drained\n    - **Arguments**\n      - `engine.Socket`: socket being flushed\n\n##### Constants and types\n\n- `Protocol` _(int)_: protocol revision number\n- `Server`: Server struct\n- `Socket`: Socket struct\n\n##### Methods\n\n- `New`\n    - Returns a new `Server` instance. If the first argument is an `*types.HttpServer`() then the\n      new `Server` instance will be attached to it. Otherwise, the arguments are passed\n      directly to the `Server` constructor.\n    - **Parameters**\n      - `*types.HttpServer`: optional, server to attach to.\n      - `any`: can be nil, interface `config.ServerOptionsInterface` or `config.AttachOptionsInterface`\n\n  The following are identical ways to instantiate a server and then attach it.\n\n```golang\nimport \"github.com/zishang520/engine.io-server-go-fasthttp/v2/config\"\nimport \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"\nimport \"github.com/zishang520/engine.io-server-go-fasthttp/v2/types\"\n\nvar httpServer *types.HttpServer // previously created with `types.NewWebServer(nil);`.\nvar eioServer engine.Server\n\n// create a server first, and then attach\neioServer = engine.NewServer(nil)\neioServer.Attach(httpServer)\n\n// or call the module as a function to get `Server`\neioServer = engine.New(nil)\neioServer.Attach(httpServer)\n\n// immediately attach\neioServer = engine.New(httpServer)\n\n// with custom options\nc := \u0026config.ServerOptions{}\nc.SetMaxHttpBufferSize(1e3)\neioServer = engine.New(httpServer, c)\n\n```\n\n- `Listen`\n    - Creates an `*types.HttpServer` which listens on the given port and attaches WS\n      to it. It returns `501 Not Implemented` for regular http requests.\n    - **Parameters**\n      - `string`: address to listen on.\n      - `any`: can be nil, interface `config.ServerOptionsInterface` or `config.AttachOptionsInterface`.\n      - `func()`: callback for `listen`.\n    - **Options**\n      - All options from `engine.Server.Attach` method, documented below.\n      - **Additionally** See Server `New` below for options you can pass for creating the new Server\n    - **Returns** `engine.Server`\n\n```golang\nimport \"github.com/zishang520/engine.io-server-go-fasthttp/v2/engine\"\nimport \"github.com/zishang520/engine.io-server-go-fasthttp/v2/config\"\n\nc := \u0026config.ServerOptions{}\nc.SetPingTimeout(2000)\nc.SetPingInterval(10_000)\n\nconst server = engine.Listen(\"127.0.0.1:3000\", c);\n\nserver.On('connection', func(...any) {});\n```\n\n- `Attach`\n    - Captures `upgrade` requests for a `*types.HttpServer`. In other words, makes\n      a regular `*types.HttpServer` WebSocket-compatible.\n    - **Parameters**\n      - `*types.HttpServer`: server to attach to.\n      - `any`: `config.ServerOptionsInterface`: can be nil, interface config.ServerOptionsInterface or config.AttachOptionsInterface\n    - **Options**\n      - All options from `engine.Server.attach` method, documented below.\n      - **Additionally** See Server `New` below for options you can pass for creating the new Server\n    - **Returns** `engine.Server` a new Server instance.\n\n#### engine.Server\n\nThe main server/manager. _Inherits from events.EventEmitter_.\n\n##### Events\n\n- `connection`\n    - Fired when a new connection is established.\n    - **Arguments**\n      - `engine.Socket`: a Socket object\n\n- `initial_headers`\n    - Fired on the first request of the connection, before writing the response headers\n    - **Arguments**\n      - `headers` (`*utils.ParameterBag`): a hash of headers\n      - `ctx` (`*types.HttpContext`): the request\n\n- `headers`\n    - Fired on the all requests of the connection, before writing the response headers\n    - **Arguments**\n      - `headers` (`*utils.ParameterBag`): a hash of headers\n      - `ctx` (`*types.HttpContext`): the request\n\n- `connection_error`\n    - Fired when an error occurs when establishing the connection.\n    - **Arguments**\n      - `types.ErrorMessage`: an object with following properties:\n        - `req` (`*types.HttpContext`): the request that was dropped\n        - `code` (`int`): one of `Server.errors`\n        - `message` (`string`): one of `Server.errorMessages`\n        - `context` (`map[string]any`): extra info about the error\n\n| Code | Message |\n| ---- | ------- |\n| -1 | \"Ok\"\n| 0 | \"Transport unknown\"\n| 1 | \"Session ID unknown\"\n| 2 | \"Bad handshake method\"\n| 3 | \"Bad request\"\n| 4 | \"Forbidden\"\n| 5 | \"Unsupported protocol version\"\n\n##### Read-only methods\n\n**Important**: if you plan to use Engine.IO in a scalable way, please\nkeep in mind the properties below will only reflect the clients connected\nto a single process.\n\n- `Clients()` _(*types.Map\\[string, engine.Socket\\])_: hash of connected clients by id.\n- `ClientsCount()` _(uint64)_: number of connected clients.\n\n##### Methods\n\n- **New**\n    - Initializes the server\n    - **Parameters**\n      - `config.ServerOptionsInterface`: can be nil, interface config.ServerOptionsInterface\n    - **Options**\n      - `SetPingTimeout(time.Duration)`: how many ms without a pong packet to\n        consider the connection closed (`20_000 * time.Millisecond`)\n      - `SetPingInterval(time.Duration)`: how many ms before sending a new ping\n        packet (`25_000 * time.Millisecond`)\n      - `SetUpgradeTimeout(time.Duration)`: how many ms before an uncompleted transport upgrade is cancelled (`10_000 * time.Millisecond`)\n      - `SetMaxHttpBufferSize(int64)`: how many bytes or characters a message\n        can be, before closing the session (to avoid DoS). Default\n        value is `1E6`.\n      - `SetAllowRequest(config.AllowRequest)`: A function that receives a given handshake or upgrade request as its first argument and can decide whether to continue. error is not empty to indicate that the request was rejected.\n      - `SetTransports(*types.Set[string])`: transports to allow connections\n        to (`['websocket']`)\n      - `SetAllowUpgrades(bool)`: whether to allow transport upgrades\n        (`true`)\n      - `SetPerMessageDeflate(*types.PerMessageDeflate)`: parameters of the WebSocket permessage-deflate extension\n        - `Threshold` (`int`): data is compressed only if the byte size is above this value (`1024`)\n      - `SetHttpCompression(*types.HttpCompression)`: parameters of the http compression for the polling transports\n        - `Threshold` (`int`): data is compressed only if the byte size is above this value (`1024`)\n      - `SetCookie(*http.Cookie)`: configuration of the cookie that\n        contains the client sid to send as part of handshake response\n        headers. This cookie might be used for sticky-session. Defaults to not sending any cookie (`nil`).\n      - `SetCors(*types.Cors)`: the options that will be forwarded to the cors module. See [there](https://pkg.go.dev/github.com/zishang520/engine.io-server-go-fasthttp/v2/types#Cors) for all available options. Defaults to no CORS allowed.\n      - `SetInitialPacket(io.Reader)`: an optional packet which will be concatenated to the handshake packet emitted by Engine.IO.\n      - `SetAllowEIO3(bool)`: whether to support v3 Engine.IO clients (defaults to `false`)\n- `Close`\n    - Closes all clients\n    - **Returns** `engine.Server` for chaining\n- `HandleRequest`\n    - Called internally when a `Engine` request is intercepted.\n    - **Parameters**\n      - `*types.HttpContext`: a node request context\n- `HandleUpgrade`\n    - Called internally when a `Engine` ws upgrade is intercepted.\n    - **Parameters**\n      - `*types.HttpContext`: a node request context\n- `Attach`\n    - Attach this Server instance to an `*types.HttpServer`\n    - Captures `upgrade` requests for a `*types.HttpServer`. In other words, makes\n      a regular *types.HttpServer WebSocket-compatible.\n    - **Parameters**\n      - `*types.HttpServer`: server to attach to.\n      - `any`: can be nil, interface config.AttachOptionsInterface\n    - **Options**\n      - `SetPath(string)`: name of the path to capture (`/engine.io`).\n      - ~~`SetDestroyUpgrade(bool)`~~: destroy unhandled upgrade requests (`true`)\n      - ~~`SetDestroyUpgradeTimeout(time.Duration)`~~: milliseconds after which unhandled requests are ended (`1000 * time.Millisecond`)\n      - `SetAddTrailingSlash(bool)`: Whether we should add a trailing slash to the request path (`true`)\n- `GenerateId`\n    - Generate a socket id.\n    - Overwrite this method to generate your custom socket id.\n    - **Parameters**\n      - `*types.HttpContext`: a node request context\n  - **Returns** A socket id for connected client.\n\n\u003chr\u003e\u003cbr\u003e\n\n#### engine.Socket\n\nA representation of a client. _Inherits from events.EventEmitter_.\n\n##### Events\n\n- `close`\n    - Fired when the client is disconnected.\n    - **Arguments**\n      - `string`: reason for closing\n      - `any`: description (optional)\n- `message`\n    - Fired when the client sends a message.\n    - **Arguments**\n      - `io.Reader`: `*types.StringBuffer` or `*types.BytesBuffer` with binary contents\n- `error`\n    - Fired when an error occurs.\n    - **Arguments**\n      - `error`: error type\n- `flush`\n    - Called when the write buffer is being flushed.\n    - **Arguments**\n      - `[]*packet.Packet`: write buffer\n- `drain`\n    - Called when the write buffer is drained\n- `packet`\n    - Called when a socket received a packet (`message`, `ping`)\n    - **Arguments**\n      - `*packet.Packet`: packet\n- `packetCreate`\n    - Called before a socket sends a packet (`message`, `ping`)\n    - **Arguments**\n      - `*packet.Packet`: packet\n- `heartbeat`\n    - Called when `ping` or `pong` packed is received (depends of client version)\n\n##### Read-only methods\n\n- `Id()` _(string)_: unique identifier\n- `Server()` _(engine.Server)_: engine parent reference\n- `Request()` _(*types.HttpContext)_: request that originated the Socket\n- `Upgraded()` _(bool)_: whether the transport has been upgraded\n- `ReadyState()` _(string)_: opening|open|closing|closed\n- `Transport()` _(transports.Transport)_: transport reference\n\n##### Methods\n\n- `Send`:\n    - Sends a message.\n    - **Parameters**\n      - `io.Reader`: `*types.StringBuffer` and `*strings.Reader` are treated as strings, others that implement the `io.Reader` interface are treated as binary.\n      - `*packet.Options`: can be nil, Options struct.\n      - `func(transports.Transport)`: can be nil, a callback executed when the message gets flushed out by the transport\n    - **\\*packet.Options**\n      - `Compress` (`bool`): whether to compress sending data. This option might be ignored and forced to be `true` when using polling. (`true`)\n    - **Returns** `engine.Socket` for chaining\n- `Close`\n    - Disconnects the client\n    - **Parameters**\n      - `bool`: Flags the transport as discarded. (`false`)\n\n### Client\n\n\u003chr\u003e\u003cbr\u003e\n\nExposed in the `eio` global namespace (in the browser), or by\n`require('engine.io-client')` (in Node.JS).\n\nFor the client API refer to the\n[engine-client](https://github.com/socketio/engine.io-client) repository.\n\n## Debug / logging\n\nIn order to see all the debug output, run your app with the environment variable\n`DEBUG` including the desired scope.\n\nTo see the output from all of Engine.IO's debugging scopes you can use:\n\n```\nDEBUG=engine*\n```\n\n## Transports\n\n- `websocket`: WebSocket transport.\n\n## Tests\n\nTests run with `make test`.\n\n## License\n\n\nMIT License\n\nCopyright (c) 2023 luoyy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzishang520%2Fengine.io-server-go-fasthttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzishang520%2Fengine.io-server-go-fasthttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzishang520%2Fengine.io-server-go-fasthttp/lists"}