[racket] Question on networking

From: Tomás Coiro (tomcoiro at hotmail.com)
Date: Thu Mar 21 22:57:11 EDT 2013

I've been seeing the examples of Racket to make a server, and although I learned a lot, I'd love to know how to actually launch it so, for example, a friend can see my page from his house.


For the best example, let's say i have the Hello World server, what changes do i need to make so someone can access it from a browser? can I use a webpage like www.hello.com ? Can I do it from my computer?    


#lang web-server/insta

;; A "hello world" web server
(define (start request)
  (response/xexpr
   '(html
     (body "Hello World"))))



Also, to make something like this work between 2 different computers over the internet:


(define listener (tcp-listen 12345))
(let echo-server ()
  (define-values (in out) (tcp-accept listener))
  (thread (lambda () (copy-port in out)
                     (close-output-port out)))
  (echo-server))


Would i need to write a client that connects to the servers IP and to the specified port?


Thanks in advance.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130322/83385c93/attachment.html>

Posted on the users mailing list.