Skip to content

Add flag to include default ports (80/443) in output #2328

Description

@iKhaled6

Description:

When using httpx, ports 80 and 443 are omitted from the output by default. This becomes problematic when piping results to other tools (like nuclei, naabu, or custom scripts) that expect or benefit from explicit port notation, or when normalizing output for consistency in asset inventories.

Example current behavior:

https://example.com    (port 443 omitted)
http://example.com     (port 80 omitted)
https://example.com:8443  (non-standard port shown)

Solution

Add a flag such as -include-default-ports or -show-all-ports that forces httpx to always display the port in output, even for 80/443.

Expected behavior with flag:

https://example.com:443
http://example.com:80
https://example.com:8443

Considered alternatives

  • Parsing JSON output and reconstructing URLs with jq
  • Post-processing with sed to append ports

These workarounds add complexity and break simple piping workflows.

Additional context

This would improve consistency when integrating httpx into automation pipelines and asset management workflows where explicit port notation is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementMost issues will probably ask for additions or changes.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions