If your goal is to run this in a browser, it won't be useful to compile tungstenite anyway — it's a WS implementation, but in browsers, raw networking is not available and you have to use their own WS API.
tungstenite needs access to TCP sockets on top of which it can implement WebSockets. Browsers don't give you sockets, only higher-level protocols that are implemented on top of TCP or UDP (HTTP, WebSocket, WebRTC, FTP, ...) so it is impossible to create TCP sockets out of that.
You have to use the existing WS implementation the browser gives you; one compiled into your code is useless.