Zalo Web Server icon

Zalo Web Server

Hosts HTML content at a specified path

Overview

The Zalo Web Server node allows you to start and stop a simple HTTP server that serves custom HTML content at a specified path. This is particularly useful for scenarios such as domain verification (e.g., for Zalo or similar services), serving static HTML files for webhooks, or providing a temporary endpoint for testing integrations.

Practical examples:

  • Hosting a verification file required by Zalo to confirm domain ownership.
  • Serving a custom HTML page for webhook validation or callback handling.
  • Quickly spinning up a local server to display specific HTML content during workflow execution.

Properties

Name Type Meaning
Host String Host to bind the server to (e.g., localhost or 0.0.0.0 to accept connections from any IP)
Port Number Port on which the web server will run
Path String URL path where the HTML content will be accessible (e.g., /zalo_verifier.html)
HTML Content String The HTML content to serve at the specified path

Output

The node outputs a JSON object with the following structure when starting a server:

{
  "success": true,
  "serverId": "server_HOST_PORT",
  "host": "HOST",
  "port": PORT,
  "path": "/PATH",
  "url": "http://HOST:PORT/PATH",
  "status": "running"
}
  • success: Indicates if the operation was successful.
  • serverId: Unique identifier for the running server instance.
  • host: The host address the server is bound to.
  • port: The port number the server is listening on.
  • path: The URL path where the HTML content is served.
  • url: The full URL to access the served HTML content.
  • status: Status of the server ("running").

If stopping servers, the output is:

{
  "success": true,
  "message": "Stopped N server(s)",
  "stoppedServers": ["server_HOST_PORT", ...]
}

Or, if no servers are running:

{
  "success": true,
  "message": "No servers running"
}

If an error occurs and "Continue On Fail" is enabled:

{
  "error": "Error message"
}

Dependencies

  • No external API keys or third-party services are required.
  • Relies on Node.js built-in http module.
  • No special n8n configuration is needed, but ensure the chosen port is available and not blocked by firewalls.

Troubleshooting

Common issues:

  • Port already in use:
    If you try to start a server on a host/port combination that's already running, you'll receive an error:
    "A server is already running on HOST:PORT"
    Resolution: Stop the existing server or choose a different port.

  • Firewall or network restrictions:
    If using 0.0.0.0, make sure your firewall allows incoming connections on the specified port.

  • HTML not accessible:
    Ensure the path starts with / and matches what you expect in the browser.

  • Node errors:
    Any unexpected errors will be logged, and if "Continue On Fail" is enabled, the error message will appear in the output.

Links and References

Discussion