adding data to scan request + Go ARMv7
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
# Define binary names
|
||||
LINUX_BIN="ScannerGO-linux"
|
||||
LINUX_ARM_BIN="ScannerGO-linuxARMv7"
|
||||
WINDOWS_BIN="ScannerGO-windows.exe"
|
||||
|
||||
echo "Starting build process..."
|
||||
@@ -28,4 +29,14 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build for Linux ARM (ARMv7)
|
||||
echo "Building for Linux ARMv7..."
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -o "$LINUX_ARM_BIN" main.go
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully built: $LINUX_ARM_BIN"
|
||||
else
|
||||
echo "Failed to build Linux ARMv7 binary"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Build complete."
|
||||
|
||||
@@ -118,6 +118,7 @@ func sendToEndpoint(baseURL, content string) {
|
||||
client := &http.Client{
|
||||
Timeout: 5 * time.Second,
|
||||
}
|
||||
|
||||
fullURL := fmt.Sprintf("%s?content=%s", baseURL, url.QueryEscape(content))
|
||||
resp, err := client.Get(fullURL)
|
||||
if err != nil {
|
||||
@@ -125,5 +126,17 @@ func sendToEndpoint(baseURL, content string) {
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// Read the response body
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
fmt.Printf("Error reading response: %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("Data: [%s] | Status: %s\n", content, resp.Status)
|
||||
if len(body) > 0 {
|
||||
fmt.Printf("Response: %s\n", string(body))
|
||||
}
|
||||
fmt.Println(strings.Repeat("-", 30))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user