diff --git a/main.go b/main.go index 10a41a6..50fb88b 100644 --- a/main.go +++ b/main.go @@ -5,11 +5,8 @@ import ( "bytes" "encoding/binary" "encoding/hex" - "os" -) - -import ( "milter-experiment/logging" + "os" ) var ( @@ -43,7 +40,7 @@ func handleMtaConnection(clientConnection *bufio.ReadWriter) { func main() { logger = logging.NewLogger(os.Stdout, os.Stderr, logging.DEBUG) - err := runServer() + err := runServer("127.0.0.1:7777") if err != nil { logger.Errorf("Could not run server: %s\n", err.Error()) os.Exit(1) diff --git a/socket.go b/socket.go index 2d7566e..3986b8c 100644 --- a/socket.go +++ b/socket.go @@ -6,8 +6,8 @@ import ( "net" ) -func runServer() error { - serverSocket, err := net.Listen("tcp", "127.0.0.1:7777") +func runServer(listenAddr string) error { + serverSocket, err := net.Listen("tcp", listenAddr) if err != nil { myError := fmt.Errorf("could not create listening socket: %s", err.Error()) return myError