mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +00:00
fix: update error handling in Start methods for netlink, nfqueue, redirect, and tproxy servers to indicate Linux support only
This commit is contained in:
parent
cd848165db
commit
9130e9c4f0
@ -3,6 +3,8 @@
|
||||
package netlink
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/sunbk201/ua3f/internal/config"
|
||||
)
|
||||
|
||||
@ -22,7 +24,7 @@ func (s *Server) Setup() (err error) {
|
||||
}
|
||||
|
||||
func (s *Server) Start() (err error) {
|
||||
return nil
|
||||
return errors.New("netlink helper is only supported on linux")
|
||||
}
|
||||
|
||||
func (s *Server) Close() (err error) {
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
package nfqueue
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/sunbk201/ua3f/internal/config"
|
||||
"github.com/sunbk201/ua3f/internal/rewrite"
|
||||
)
|
||||
@ -25,7 +27,7 @@ func (s *Server) Setup() (err error) {
|
||||
}
|
||||
|
||||
func (s *Server) Start() (err error) {
|
||||
return nil
|
||||
return errors.New("nfqueue server is only supported on linux")
|
||||
}
|
||||
|
||||
func (s *Server) Close() (err error) {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
package redirect
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"net"
|
||||
|
||||
"github.com/sunbk201/ua3f/internal/config"
|
||||
@ -24,7 +24,7 @@ func New(cfg *config.Config, rw *rewrite.Rewriter) *Server {
|
||||
}
|
||||
|
||||
func (s *Server) Start() error {
|
||||
return fmt.Errorf("REDIRECT Mode is only supported on Linux")
|
||||
return errors.New("redirect server is only supported on linux")
|
||||
}
|
||||
|
||||
func (s *Server) Close() error {
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
package tproxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"net"
|
||||
|
||||
"github.com/sunbk201/ua3f/internal/config"
|
||||
@ -24,7 +24,7 @@ func New(cfg *config.Config, rw *rewrite.Rewriter) *Server {
|
||||
}
|
||||
|
||||
func (s *Server) Start() error {
|
||||
return fmt.Errorf("TPROXY Mode is only supported on Linux")
|
||||
return errors.New("tproxy server is only supported on linux")
|
||||
}
|
||||
|
||||
func (s *Server) Close() error {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user