feat: close connection if no tunneling request is specified
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 7m18s
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 7m18s
This commit is contained in:
@ -2,11 +2,12 @@ package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golang.org/x/crypto/ssh"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"tunnel_pls/utils"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@ -16,12 +17,12 @@ type Server struct {
|
||||
}
|
||||
|
||||
func NewServer(config ssh.ServerConfig) *Server {
|
||||
listener, err := net.Listen("tcp", fmt.Sprintf(":%s", utils.Getenv("port")))
|
||||
listener, err := net.Listen("tcp", fmt.Sprintf(":%s", utils.Getenv("SSH_PORT")))
|
||||
if err != nil {
|
||||
log.Fatalf("failed to listen on port 2200: %v", err)
|
||||
return nil
|
||||
}
|
||||
if utils.Getenv("tls_enabled") == "true" {
|
||||
if utils.Getenv("TLS_ENABLED") == "true" {
|
||||
go func() {
|
||||
err := NewHTTPSServer()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user