Guest User

webserver demo

a guest
Mar 6th, 2013
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bash-4.2$ netcat localhost 36895 <<< 'GET / HTTP/1.1'
  2. HTTP/1.1 200 Ok
  3. Content-Type:text/plain
  4.  
  5.  
  6. read(net): Connection reset by peer
  7.  
  8. bash-4.2$ netcat localhost 36895 <<< 'WRONG / HTTP/1.1'
  9. HTTP/1.1 405 Not Supported
  10. Content-Type:text/plain
  11.  
  12. 405 Not Supported
  13. read(net): Connection reset by peer
  14.  
  15. bash-4.2$ netcat localhost 36895 <<< 'GET /missing HTTP/1.1'
  16. HTTP/1.1 404 Not Found
  17. Content-Type:text/plain
  18.  
  19. 404 Not Found
  20. read(net): Connection reset by peer
  21.  
  22. bash-4.2$ netcat localhost 36895 <<< 'GET /unreadable HTTP/1.1'
  23. HTTP/1.1 500 Server Error
  24. Content-Type:text/plain
  25.  
  26. 500 Server Error
  27. read(net): Connection reset by peer
  28.  
  29. bash-4.2$ netcat localhost 36895 <<< 'GET /test.txt HTTP/1.1'
  30. HTTP/1.1 200 Ok
  31. Content-Type:text/plain
  32.  
  33. Plain Text Test File
  34. read(net): Connection reset by peer
  35.  
  36. bash-4.2$ netcat localhost 36895 <<< 'GET /test.html HTTP/1.1'
  37. HTTP/1.1 200 Ok
  38. Content-Type:text/html
  39.  
  40. <!DOCTYPE html>
  41. <head>
  42. <meta charset=iso-8859-1>
  43. <title></title>
  44. </head>
  45. <body>
  46. <h1>HTML Test Page</h1>
  47. <p>
  48. Although served as application/octet-stream,<br>
  49. the browsers tend to display inline images.<br>
  50. <img src="apple-touch-icon.png">
  51. </p>
  52. </body>
  53. </html>
  54. read(net): Connection reset by peer
  55.  
  56. bash-4.2$ netcat localhost 36895 <<< 'GET /test.csv HTTP/1.1'
  57. HTTP/1.1 200 Ok
  58. Content-Type:application/octet-stream
  59.  
  60. CSV,"test file"
  61. served,"as binary"
  62. read(net): Connection reset by peer
RAW Paste Data