Working thorough Iron lib

Hi everyone.
I’m trying to make my Iron server public(to be accessable by my machine’s ip) and found that std::net::TcpStream could help me as : it is
A structure which represents a TCP stream between a local socket and a remote socket according to the documentation. So i ve got next:

let mut con=TcpStream::connect(“”).unwrap();

but got:

^^^^ the trait std::net::ToSocketAddrs is not implemented for std::net::TcpStream
According to the compiler i have to impl ToSocketAddrs for TcpStream
but ive got lost trying to do it.
Can anyone help me out with it?
And is this approach correct in achieving the goal?

Iron creates the TcpStream for you using a socket address you provide (via the http() method). You’re probably looking for this:


I wished it work. But it didnt. The server is not accessible by my ip with
such syntax. I swam across the sea of info about iron server but only
localhost examples. Not a word about public server.

I think you want to use "".

No guys, I was a milk drinker and didn’t know that i had to turn the ip-routing and Wins-proxy on, to provide a server service. GIGGLING , I ve spent almost a week to solve a problem, terrorising people, and everything was solved just in a few clicks. SORRY GUYS.