@@ -592,6 +592,28 @@ func (g *LightningTerminal) startMainWebServer() error {
592
592
}
593
593
}()
594
594
595
+ // We only enable an additional HTTP only listener if the user
596
+ // explicitly sets a value.
597
+ if g .cfg .HTTPListen != "" {
598
+ insecureListener , err := net .Listen ("tcp" , g .cfg .HTTPListen )
599
+ if err != nil {
600
+ return fmt .Errorf ("unable to listen on %v: %v" ,
601
+ g .cfg .HTTPListen , err )
602
+ }
603
+
604
+ g .wg .Add (1 )
605
+ go func () {
606
+ defer g .wg .Done ()
607
+
608
+ log .Infof ("Listening for http on: %v" ,
609
+ insecureListener .Addr ())
610
+ err := g .httpServer .Serve (insecureListener )
611
+ if err != nil && err != http .ErrServerClosed {
612
+ log .Errorf ("http server error: %v" , err )
613
+ }
614
+ }()
615
+ }
616
+
595
617
return nil
596
618
}
597
619
@@ -611,8 +633,8 @@ func (g *LightningTerminal) showStartupInfo() error {
611
633
version : build .Version (),
612
634
webURI : fmt .Sprintf ("https://%s" , strings .ReplaceAll (
613
635
strings .ReplaceAll (
614
- g .cfg .HTTPSListen , "0.0.0.0" , "127.0.0.1 " ,
615
- ), "[::]" , "[::1] " ,
636
+ g .cfg .HTTPSListen , "0.0.0.0" , "localhost " ,
637
+ ), "[::]" , "localhost " ,
616
638
)),
617
639
}
618
640
@@ -659,6 +681,16 @@ func (g *LightningTerminal) showStartupInfo() error {
659
681
}
660
682
}
661
683
684
+ // If there's an additional HTTP listener, list it as well.
685
+ if g .cfg .HTTPListen != "" {
686
+ host := strings .ReplaceAll (
687
+ strings .ReplaceAll (
688
+ g .cfg .HTTPListen , "0.0.0.0" , "localhost" ,
689
+ ), "[::]" , "localhost" ,
690
+ )
691
+ info .webURI = fmt .Sprintf ("%s, http://%s" , info .webURI , host )
692
+ }
693
+
662
694
str := "" +
663
695
"----------------------------------------------------------\n " +
664
696
" Lightning Terminal (LiT) by Lightning Labs \n " +
0 commit comments