Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Make the shortest proxy server.

Input/Output Specifications

Client:

  • Input: a port number (32-bit integer) (,) or (space) a url (see test cases)
  • Output: html source of the url

Server:

  • Input: port to listen to (32-bit integer)
  • Output: REC when input is received from the client, OK when finished sending the html source to the client.

Rules

  • You may make either a complete program or functions in an interpreted language.
  • Input is taken through stdin or given as a arguments.
  • Your code has to work for the given test cases only (more is optional, less is invalid).
  • The client output has to be the same as with what you get when you "view source" from a browser.
  • The server may exit after each handled request (i.e does not have to be persistent/daemon)
  • (edit) Any other input/output than what specified, is forbidden.

Test cases (client inputs)

  1. N1 http://stackoverflow.com/https://stackoverflow.com/
  2. N2 http://en.wikipedia.org/wiki/Proxy_server
  3. N3 http://stackexchange.com/search?q=code+golf

where Ni are random integers between 1 and 2048.

Make the shortest proxy server.

Input/Output Specifications

Client:

  • Input: a port number (32-bit integer) (,) or (space) a url (see test cases)
  • Output: html source of the url

Server:

  • Input: port to listen to (32-bit integer)
  • Output: REC when input is received from the client, OK when finished sending the html source to the client.

Rules

  • You may make either a complete program or functions in an interpreted language.
  • Input is taken through stdin or given as a arguments.
  • Your code has to work for the given test cases only (more is optional, less is invalid).
  • The client output has to be the same as with what you get when you "view source" from a browser.
  • The server may exit after each handled request (i.e does not have to be persistent/daemon)
  • (edit) Any other input/output than what specified, is forbidden.

Test cases (client inputs)

  1. N1 http://stackoverflow.com/
  2. N2 http://en.wikipedia.org/wiki/Proxy_server
  3. N3 http://stackexchange.com/search?q=code+golf

where Ni are random integers between 1 and 2048.

Make the shortest proxy server.

Input/Output Specifications

Client:

  • Input: a port number (32-bit integer) (,) or (space) a url (see test cases)
  • Output: html source of the url

Server:

  • Input: port to listen to (32-bit integer)
  • Output: REC when input is received from the client, OK when finished sending the html source to the client.

Rules

  • You may make either a complete program or functions in an interpreted language.
  • Input is taken through stdin or given as a arguments.
  • Your code has to work for the given test cases only (more is optional, less is invalid).
  • The client output has to be the same as with what you get when you "view source" from a browser.
  • The server may exit after each handled request (i.e does not have to be persistent/daemon)
  • (edit) Any other input/output than what specified, is forbidden.

Test cases (client inputs)

  1. N1 https://stackoverflow.com/
  2. N2 http://en.wikipedia.org/wiki/Proxy_server
  3. N3 http://stackexchange.com/search?q=code+golf

where Ni are random integers between 1 and 2048.

edited tags; edited title
Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135

Build a simple proxy.

Tweeted twitter.com/#!/StackCodeGolf/status/48306009365676032
added 72 characters in body
Source Link
Eelvex
  • 5.5k
  • 1
  • 28
  • 43

Make the shortest proxy server.

Input/Output Specifications

Client:

  • Input: a port number (32-bit integer) (,) or (space) a url (see test cases)
  • Output: html source of the url

Server:

  • Input: port to listen to (32-bit integer)
  • Output: REC when input is received from the client, OK when finished sending the html source to the client.

Rules

  • You may make either a complete program or functions in an interpreted language.
  • Input is taken through stdin or given as a arguments.
  • Your code has to work for the given test cases only (more is optional, less is invalid).
  • The client output has to be the same as with what you get when you "view source" from a browser.
  • The server may exit after each handled request (i.e does not have to be persistent/daemon)
  • (edit) Any other input/output than what specified, is forbidden.

Test cases (client inputs)

  1. N1 http://stackoverflow.com/
  2. N2 http://en.wikipedia.org/wiki/Proxy_server
  3. N3 http://stackexchange.com/search?q=code+golf

where Ni are random integers between 1 and 2048.

Make the shortest proxy server.

Input/Output Specifications

Client:

  • Input: a port number (32-bit integer) (,) or (space) a url (see test cases)
  • Output: html source of the url

Server:

  • Input: port to listen to (32-bit integer)
  • Output: REC when input is received from the client, OK when finished sending the html source to the client.

Rules

  • You may make either a complete program or functions in an interpreted language.
  • Input is taken through stdin or given as a arguments.
  • Your code has to work for the given test cases only (more is optional, less is invalid).
  • The client output has to be the same as with what you get when you "view source" from a browser.
  • The server may exit after each handled request (i.e does not have to be persistent/daemon)

Test cases (client inputs)

  1. N1 http://stackoverflow.com/
  2. N2 http://en.wikipedia.org/wiki/Proxy_server
  3. N3 http://stackexchange.com/search?q=code+golf

where Ni are random integers between 1 and 2048.

Make the shortest proxy server.

Input/Output Specifications

Client:

  • Input: a port number (32-bit integer) (,) or (space) a url (see test cases)
  • Output: html source of the url

Server:

  • Input: port to listen to (32-bit integer)
  • Output: REC when input is received from the client, OK when finished sending the html source to the client.

Rules

  • You may make either a complete program or functions in an interpreted language.
  • Input is taken through stdin or given as a arguments.
  • Your code has to work for the given test cases only (more is optional, less is invalid).
  • The client output has to be the same as with what you get when you "view source" from a browser.
  • The server may exit after each handled request (i.e does not have to be persistent/daemon)
  • (edit) Any other input/output than what specified, is forbidden.

Test cases (client inputs)

  1. N1 http://stackoverflow.com/
  2. N2 http://en.wikipedia.org/wiki/Proxy_server
  3. N3 http://stackexchange.com/search?q=code+golf

where Ni are random integers between 1 and 2048.

added 98 characters in body
Source Link
Eelvex
  • 5.5k
  • 1
  • 28
  • 43
Loading
Source Link
Eelvex
  • 5.5k
  • 1
  • 28
  • 43
Loading