summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/server.go b/server.go
index 24b1e77..434412b 100644
--- a/server.go
+++ b/server.go
@@ -180,8 +180,12 @@ func (server *Server) GetStats() Stats {
return *server.Stats
}
-func (server *Server) ListenAndServe(listenString string) error {
- ln, err := net.Listen("tcp", listenString)
+func (server *Server) ListenAndServe(listenString string, args ...string) error {
+ network := "tcp"
+ if (len(args) > 0) {
+ network = args[0]
+ }
+ ln, err := net.Listen(network, listenString)
if err != nil {
return err
}