Chrome network error · -102 · Connection
ERR_CONNECTION_REFUSED
Chromium's description
A connection attempt was refused.
Chrome shows it as net::ERR_CONNECTION_REFUSED, error -102. puppeteer and Playwright report the same name when a page fails to load in Chromium.
Common causes
- The web server (nginx, Apache, Node, a dev server) is not running or crashed.
- The site listens on another port than the URL uses, e.g. a dev server on 3000 opened as port 80, or HTTPS (443) is not set up.
- A firewall rejects connections to the port.
- localhost or 127.0.0.1 points at your own machine, where nothing is listening.
How to fix ERR_CONNECTION_REFUSED
- Check the port in the URL and that the server is running and listening on it (
ss -ltnpornetstat -an). - For a site you do not run: wait and retry, it is usually down for maintenance or overloaded.
- Clear a proxy you no longer use from the browser or system settings.
- Site owners: open the port in the firewall or security group and bind the server to the public interface, not only to 127.0.0.1.
ERR_CONNECTION_REFUSED in the screenshot API
The renderer connects through its own egress proxy (it checks every address against private and internal ranges), so the API reports a connection that could not be opened as ERR_CONNECTION_FAILED: status 502 with the message The target website could not be loaded (ERR_CONNECTION_FAILED). A local or internal address such as localhost is refused with 422 before any connection is tried. Not billed.
Only the page's own load can fail a render. An image, script or frame of the page that fails with a network error does not: the page is captured as the browser shows it without that resource.
Check whether a website loads
Frequently asked questions
What does ERR_CONNECTION_REFUSED mean?
How do I fix ERR_CONNECTION_REFUSED?
ss -ltnp or netstat -an).Is a screenshot that fails with ERR_CONNECTION_REFUSED billed?
Other common errors
Screenshot API
Take screenshots from your code
screenshotbase renders any website in a real browser and returns the image: full page or viewport, any device size, retina, from 100+ countries, with cookie banners and ads hidden.
/v1/take documentation Screenshot API All documentation
300 free screenshots every month. No credit card required.
GET https://api.screenshotbase.com/v1/take?url=https://example.com&full_page=true
# Response: the image (PNG, JPG, WebP or GIF)
curl -G "https://api.screenshotbase.com/v1/take" \
--data-urlencode "url=https://example.com" \
-d viewport_width=1280 -d viewport_height=800 \
-d format=png \
-H "apikey: YOUR-API-KEY" \
-o screenshot.png