Put the random selection inside the shell started for each job. Expanding a command substitution in the outer shell selects the value before xargs begins its work.

With a validated proxies.txt containing one proxy URL per line, public candidates can come from the free proxy list; format each entry with a protocol supported by curl:

printf '%s\0' 'https://a.example/one' 'https://b.example/two' |
  xargs -0 -n 1 -P 4 sh -c '
    proxy=$(shuf -n 1 proxies.txt) || exit 1
    [ -n "$proxy" ] || exit 1
    curl --fail --silent --show-error --max-time 30 \
      --proxy "$proxy" --noproxy "" --output /dev/null "$1"
  ' _

-n 1 supplies one URL to each command, and -P 4 allows up to four commands at a time. The null-delimited input preserves the URL as one argument. The underscore occupies sh’s $0 position, leaving the URL in $1.

Each child shell runs shuf independently. Random selection can choose the same proxy more than once; it is not round-robin scheduling or a guarantee of different exit addresses.

The explicit empty bypass list keeps an inherited no_proxy setting from bypassing the chosen intermediary. The example discards response bodies; use separate output paths when saving concurrent downloads.

Artihkkalat mat laktásit