55package main
66
77import (
8- "context"
98 "flag"
109 "fmt"
1110 "os"
1211 "path"
13- "time"
1412
15- amasshttp "github.com/owasp-amass/amass/v5/internal/net/http "
13+ "github.com/owasp-amass/amass/v5/engine/api/client "
1614)
1715
1816func main () {
@@ -27,24 +25,18 @@ func main() {
2725 flag .BoolVar (& help1 , "h" , false , "Show the program usage message" )
2826 flag .BoolVar (& help2 , "help" , false , "Show the program usage message" )
2927 flag .StringVar (& hostname , "host" , "" , "Hostname or IP address of the Amass Engine" )
30- //flag.BoolVar(&version, "version", false, "Print the version number of this Amass binary")
3128 flag .Parse ()
3229
3330 if (help1 || help2 ) || hostname == "" {
3431 fmt .Fprintf (os .Stderr , "Usage: %s %s\n \n " , path .Base (os .Args [0 ]), "--host HOSTNAME" )
3532 flag .PrintDefaults ()
3633 return
3734 }
38- /*if version {
39- fmt.Fprintf(color.Error, "%s\n", format.Version)
40- return
41- }*/
4235
43- ctx , cancel := context . WithTimeout ( context . Background (), 3 * time . Second )
44- defer cancel ()
36+ c := client . NewClient ( "http://" + hostname + ":4000" )
37+ defer c . Close ()
4538
46- u := "http://" + hostname + ":4000"
47- if _ , err := amasshttp .RequestWebPage (ctx , & amasshttp.Request {URL : u }); err != nil {
39+ if ! c .HealthCheck () {
4840 // a failure to respond indicates that the server is not yet available
4941 os .Exit (1 )
5042 }
0 commit comments