Skip to content

Unable to enableNetConnect for localhost (127.0.0.1) #1661

Discussion options

You must be logged in to vote

Turns out enableNetConnect looks for an exact match for a given host, and doesn’t ignore the port. As a port is randomly assigned in each test, I used a regex instead:

agent.enableNetConnect(/(?:127\.0\.0\.1:\d{5})/);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paulrobertlloyd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant