-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use a single socket-io endpoint (#23)
Signed-off-by: Tiger Wang <[email protected]>
- Loading branch information
Showing
10 changed files
with
193 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package route | ||
|
||
import "github.com/labstack/echo/v4" | ||
|
||
func (r *APIRoute) SubscribeSIO(ctx echo.Context) error { | ||
server := r.services.SocketIOService.Server() | ||
server.ServeHTTP(ctx.Response(), ctx.Request()) | ||
return nil | ||
} | ||
|
||
// unfortunately need to duplicate the func to support both `/socket.io` and `/socket.io/` (with a trailing slash) API endpoints | ||
func (r *APIRoute) SubscribeSIO2(ctx echo.Context) error { | ||
return r.SubscribeSIO(ctx) | ||
} | ||
|
||
func (r *APIRoute) PollSIO(ctx echo.Context) error { | ||
server := r.services.SocketIOService.Server() | ||
server.ServeHTTP(ctx.Response(), ctx.Request()) | ||
return nil | ||
} | ||
|
||
// unfortunately need to duplicate the func to support both `/socket.io` and `/socket.io/` (with a trailing slash) API endpoints | ||
func (r *APIRoute) PollSIO2(ctx echo.Context) error { | ||
return r.PollSIO(ctx) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.