mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
Remove legacy mode.
- Deleted the legacy WebSocket client implementation (`wstoclient.go`) and its test file (`wstoclient_test.go`). - Removed legacy handling from the HTTP manager, including legacy proxy setup and routing. - Cleaned up session management by removing legacy host checks and related functions. - Eliminated the legacy WebRTC handler and its associated logic. - Updated session interface to remove legacy methods. - Removed legacy API documentation and configuration options from migration guide and help files.
This commit is contained in:
@@ -2,7 +2,6 @@ package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
@@ -10,10 +9,8 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/m1k1o/neko/server/internal/config"
|
||||
"github.com/m1k1o/neko/server/internal/http/legacy"
|
||||
"github.com/m1k1o/neko/server/pkg/types"
|
||||
)
|
||||
|
||||
@@ -139,24 +136,6 @@ func (manager *HttpManagerCtx) Start() {
|
||||
}
|
||||
}()
|
||||
manager.logger.Info().Msgf("https listening on %s", manager.http.Addr)
|
||||
|
||||
// if we have legacy mode, we need to start local http server too
|
||||
if viper.GetBool("legacy") {
|
||||
// create a listener for the API server with a random port
|
||||
listener, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
manager.logger.Panic().Err(err).Msg("unable to start legacy http proxy")
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := http.Serve(listener, manager.router); err != http.ErrServerClosed {
|
||||
manager.logger.Panic().Err(err).Msg("unable to start http server")
|
||||
}
|
||||
}()
|
||||
manager.logger.Info().Msgf("legacy proxy listening on %s", listener.Addr().String())
|
||||
|
||||
legacy.New(listener.Addr().String(), manager.config.PathPrefix).Route(manager.router)
|
||||
}
|
||||
} else {
|
||||
go func() {
|
||||
if err := manager.http.ListenAndServe(); err != http.ErrServerClosed {
|
||||
@@ -164,11 +143,6 @@ func (manager *HttpManagerCtx) Start() {
|
||||
}
|
||||
}()
|
||||
manager.logger.Info().Msgf("http listening on %s", manager.http.Addr)
|
||||
|
||||
// start legacy proxy if enabled
|
||||
if viper.GetBool("legacy") {
|
||||
legacy.New(manager.http.Addr, manager.config.PathPrefix).Route(manager.router)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user