![how to portforward a rust server how to portforward a rust server](https://i3.ytimg.com/vi/K8egWoCXBso/hqdefault.jpg)
I've already tried playing with some of the above, but I'll appreciate any suggestions of paths to explore, preferably along with an explanation as to why that might be the problem :) Rust itself - it's my first relatively earnest attempt at learning a systems programming language.HTTP: maybe I need to tinker with HTTP headers before forwarding the request to the remote server? or maybe I'm giving up to soon on the response stream by just calling channel.read_to_end()?.Rust's stream reading/writing APIs: maybe the call to channel.read_to_end() works differently than I think and just accidentally does the right thing for some kinds of requests?.
![how to portforward a rust server how to portforward a rust server](https://i.imgur.com/W3QJsRf.png)
I see various potential areas where the bug might be lurking in my code: I expect that other more complex apps will also be affected. Crucially, when using ssh -L 5000:localhost:8080, even Cloud9 Core works fine. Other (simpler?) web apps or static sites seem to work fine. nothing is read in the call to channel.read_to_end(). css) systematically come back empty (whether requested by the main page or directly), i.e. if the app running on the remote server is the Cloud9 IDE Core/SDK, the main HTML page gets loaded and some resources as well, but requests for other resources (. Println!("REQUEST ( BYTES AS RESPONSE", read_bytes) Īs it turns out, this kind of works, but not quite. Let read_bytes = stream.read(&mut request).unwrap() Println!("Started listening, ready to accept") Let listener = net::TcpListener::bind("localhost:5000").unwrap()
![how to portforward a rust server how to portforward a rust server](https://www.easypc.io/img/game-hosts/rust/dedicated/rust.jpg)
How to portforward a rust server password#
substitute appropriate values for username and password
![how to portforward a rust server how to portforward a rust server](https://pictshare.net/4dgnge.png)
Let mut session = ssh2::Session::new().unwrap() Let tcp = net::TcpStream::connect(":22").unwrap() establish SSH session with remote host
How to portforward a rust server plus#
I realize ssh already does exactly this and reliably, this is a learning project, plus I might be adding some functionality if I get it to work :) This is a barebones (no threading, no error handling) version of what I've come up with so far (should compile on Rust 1.8): extern crate ssh2 // see 'please let me know if there are other options.I'm trying to write a small program in Rust to accomplish basically what ssh -L 5000:localhost:8080 does: establish a tunnel between localhost:5000 on my machine and localhost:8080 on a remote machine, so that if an HTTP server is running on port 8080 on the remote, I can access it on my local via localhost:5000, bypassing the remote's firewall which might be blocking external access to 8080. Leave all the ports as normal, i didn't have time to find out if you can run serve RUST on different ports and have it all forward nicely ' I however have the luxury of 2 WAN connections so can cheat by forwarding one server to each separate WAN connection. Network is custom : br0 then assign an ip in your network subnet one for each rust server I have my 2 RUST servers running parallel That way it keeps it separate but also doubles up on storage use. I also made 2 separate docker containers by renaming one and giving it a separate IP address and a separate /steamcmd/rust2 mapping. Ive been stopping my container and using krusader to move the files from /appdata/Rust-Server to your chosen mapping/save location I'm 90% sure the container will create /steamcmd/rust the first time you click apply, Scroll to bottom click show more settingsĬhange Mapping Directory to the location you want to have the Docker container store the files Mapping /steamcmd/rust for data/settings retention