Browser Socket Access

Discussions focus on browsers' lack of direct TCP/UDP socket support, reliance on WebSockets or proxies for networking, and security concerns around localhost/private network access from web pages.

➡️ Stable 0.6x Web Development
2,266
Comments
20
Years Active
5
Top Authors
#2150
Topic ID

Activity Over Time

2007
4
2008
5
2009
15
2010
28
2011
41
2012
87
2013
67
2014
53
2015
121
2016
147
2017
135
2018
171
2019
192
2020
282
2021
169
2022
157
2023
212
2024
150
2025
219
2026
11

Keywords

JS CLI AppService LLMNR SSH PC UXSS UDP AI DNS browser browsers tcp websocket udp websockets localhost uwp server sockets

Sample Comments

frankenst1 May 20, 2021 View on HN

I assume you still can't use UDP or bind to TCP sockets that are accessible outside of the browser?

jakeogh Oct 11, 2024 View on HN

URL requests should go to a OS level, where the user can intercept them at will. We do not need to give browsers the socket API.

somebee Jun 21, 2018 View on HN

We have a need for this at scrimba.com, where we are now developing a way for people to record coding casts with access to local files and your local terminal. We want to let people record from any directory using a simple CLI (you only need to install an npm package). This will start a websocket-server locally, and then open up your browser at scrimba.com - which connects to said socket. This works in chrome since we're allowed to connect to ws://127.0.0.1, but other browsers nee

db48x Apr 1, 2019 View on HN

The browser doesn't provide the usual POSIX api for opening TCP connections. With some work you can write a shim library that implements it in terms of websockets, but it still can't connect to arbitrary hosts. Instead you have to run a proxy server for it to connect to.

ntonozzi May 30, 2023 View on HN

How do they get networking and sockets working in the browser? As far as I know, no browsers allow raw network access. Some apps can get around this by using things like a websocket proxy, but this relies on routing your network traffic through a third party. It'd be great to see this solved and to let users host ephemeral network servers from their browsers.

MaxBarraclough Aug 20, 2020 View on HN

How is this implemented? Is there a feature in the browser that opens a TCP port to receive incoming connections? If so, how can I switch this off?

Mandatum Sep 8, 2014 View on HN

If only WebSockets allowed for raw TCP/UDP requests in the browser - would bypass the need to connect over a third-party server..

mattlondon Dec 22, 2023 View on HN

Applications that need to make direct TCP/UDP connections to things, but which you want to run in the browser and don't want to rely on a centralised websockets proxy or other hacks.Endless use-cases for this. Servers, games, collaboration tools, clients for non-HTTP protocols (email, gopher, Gemini etc), file sharing. You name it.

1023bytes May 20, 2021 View on HN

Must be some sort of tunneling, because it works outside the browser too

zarzavat Jan 30, 2024 View on HN

This is definitely out of scope for web browsers. The security implications of allowing arbitrary sockets are prohibitive.To do something like that then you’re going to need a different environment with a different set of security guarantees and expectations, more like a shell where the user is responsible for vouching for the code’s trustworthiness.