Skip to content

Conversation

@Rhan2020
Copy link

Proposed Changes

Fixes #859

Problem

The -l/-list file input and stdin treat each line as a single target, not splitting on commas like the -u option does. This causes comma-separated entries (e.g. 192.168.1.0/24,192.168.2.0/24) to fail with no address found for host errors because the entire comma-separated string is treated as a single hostname.

Solution

Add comma-splitting logic in processInputItem so it applies uniformly to all input sources in a single place. When input contains a comma, it is split, trimmed, and each non-empty item is processed individually via recursive call.

This approach differs from previous attempts that duplicated the split logic at each call site (file reader and stdin reader). By handling it in processInputItem, the fix is DRY and automatically covers any future input sources.

Changes

  • Modified processInputItem in internal/runner/runner.go to detect and split comma-separated entries
  • Added 3 tests:
    • Test_InputCommaSeparated_processInputItem — comma-separated domains
    • Test_InputCommaSeparatedCIDR_processInputItem — comma-separated CIDRs
    • Test_InputListCommaSeparated_normalizeAndQueueInputs — comma-separated entries from file input

Proof

Before (single line fails):

echo "192.168.1.1,192.168.2.1" > /tmp/test.txt
./tlsx -l /tmp/test.txt -p 443
# [WRN] Could not connect input 192.168.1.1,192.168.2.1:443

After (both hosts processed separately):

echo "192.168.1.1,192.168.2.1" > /tmp/test.txt
./tlsx -l /tmp/test.txt -p 443
# Scans 192.168.1.1:443 and 192.168.2.1:443 separately

Checklist

  • PR created against the correct branch (dev)
  • All checks passed (lint, unit/integration/regression tests)
  • No dependency changes (go.mod/go.sum untouched)

…input

The -l/-list file input and stdin were treating each line as a single
target, not splitting on commas like the -u option does. This caused
comma-separated entries to fail with 'no address found for host' errors.

Fix: Add comma-splitting logic in processInputItem so it applies
uniformly to all input sources (file, stdin, and -u) in a single place,
rather than duplicating the logic at each call site.

Fixes projectdiscovery#859
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Rhan2020 Rhan2020 force-pushed the fix/list-comma-separated branch from de151df to d710981 Compare February 11, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant