[gameprogrammer] Re: TCP/IP Problem: NAT

On Sat, 2004-11-20 at 02:03, Chris Nystrom wrote:
> Hmmm... I am on the NAT machine and I SSH to a server, and then I type
> "xclock" and
> the xclock pops right up on the display of the origianal NAT machine.
> How does the xclock app running on the server know how to communicate
> back to the X server running on the NAT machine to display itself?
> 
> I assume this must be some ssh mojo? xclock knows nothing of ssh right
> ? So how does X know how to use the ssh mojo ? More importantly how
> can one set up ones own application to work the same way ?
> 
> Interstingly, the DISPLAY variable that ssh sets up is set to
> localhost...hmmm...a mystery.

The ssh on the server side creates a dummy X server that just forwards
all X commands through the ssh connection to the X server on the client
side. That's why you see localhost in DISPLAY.

You can see with netstat that there are no additional connections made.

Ssh does all the work, so you don't have to do anything to get your own
applications act the same. They all obey the DISPLAY environment
variable.


-- 
Petri Latvala




---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: