@@ -49,7 +49,7 @@ func createServer(a typing.Augment) error {
4949
5050 // create server
5151 server .HTTP = & http.Server {
52- Addr : server .Augment .Port ,
52+ Addr : fmt . Sprintf ( "%s:%s" , server .Augment .Host , server . Augment . Port ) ,
5353 ReadTimeout : time .Duration (server .Augment .ReadTimeout ) * time .Second ,
5454 WriteTimeout : time .Duration (server .Augment .WriteTimeout ) * time .Second ,
5555 MaxHeaderBytes : server .Augment .MaxHeaderBytes ,
@@ -80,6 +80,7 @@ func Stark(augmentation ...typing.Augment) error {
8080 ReadHeaderTimeout : constant .ReadTimeout ,
8181 WriteTimeout : constant .WriteTimeout ,
8282 ShutdownTimeout : constant .ShutdownTimeout ,
83+ Host : constant .Host ,
8384 Port : constant .Port ,
8485 Logging : & constant .Logging ,
8586 Recovery : & constant .Recovery ,
@@ -107,8 +108,11 @@ func Stark(augmentation ...typing.Augment) error {
107108 if aug .WriteTimeout != 0 {
108109 augu .WriteTimeout = aug .WriteTimeout
109110 }
111+ if aug .Host != "" {
112+ augu .Host = aug .Host
113+ }
110114 if aug .Port != "" {
111- augu .Port = fmt . Sprintf ( ":%s" , aug .Port )
115+ augu .Port = aug .Port
112116 }
113117 if aug .ReadHeaderTimeout != 0 {
114118 augu .ReadHeaderTimeout = aug .ReadHeaderTimeout
@@ -147,7 +151,7 @@ func Beck() error {
147151 shutdown ()
148152 }()
149153 // start server
150- logger .Info (fmt .Sprintf ("BARF server started at http://localhost%s" , server .Augment .Port ))
154+ logger .Info (fmt .Sprintf ("BARF server started at http://%s:%s" , server . Augment . Host , server .Augment .Port ))
151155 if err := server .HTTP .ListenAndServe (); err != nil {
152156 server .Beckoned = nil
153157 return err
0 commit comments