Upgrade Gin version and print the query string

This commit is contained in:
M. Mert Yildiran
2021-09-19 13:59:36 +03:00
parent fabffcdbc1
commit aa09f904ee
5 changed files with 8 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ func readConnectionSingle(wg *sync.WaitGroup, conn net.Conn, entry *map[string]i
command := handleCommands(text)
if !command {
fmt.Printf("\b\b** %s\n> ", text)
// fmt.Printf("\b\b** %s\n> ", text)
if text == "" {
err := scanner.Err()
@@ -126,7 +126,7 @@ func readConnection(wg *sync.WaitGroup, conn net.Conn, ws *websocket.Conn) {
command := handleCommands(text)
if !command {
fmt.Printf("\b\b** %s\n> ", text)
// fmt.Printf("\b\b** %s\n> ", text)
if text == "" {
err := scanner.Err()

View File

@@ -2,6 +2,7 @@ package api
import (
"errors"
"fmt"
"net/http"
"sync"
"time"
@@ -41,6 +42,7 @@ func init() {
func WebSocketRoutes(app *gin.Engine, eventHandlers EventHandlers) {
app.GET("/ws", func(c *gin.Context) {
fmt.Printf("query: %v\n", c.Request.URL.Query())
query := c.DefaultQuery("q", "")
websocketHandlerUI(c.Writer, c.Request, eventHandlers, false, query)
})