CORS

Basically when the request from client with URL a.b.c/sdfdf/sdfsdf.aspx
comes for a server resource with URL d.b.c/werqwer/ertrer.aspx,

then this is a cross domain request and is not allowed by the browser itself per the same origin security policy.

CORS defines a way in which the browser and the server can interact to determine whether or not to allow the cross-origin request.[2] It is more powerful than only allowing same-origin requests, but it is more secure than simply allowing all such cross-origin requests.

The CORS standard works by adding new HTTP headers that allow servers to serve resources to permitted origin domains. Browsers support these headers and enforce the restrictions they establish.

Additionally, for HTTP request methods that can cause side-effects on user data (in particular, for HTTP methods other than GET, or for POST usage with certain MIME types), the specification mandates that browsers “preflight” the request, soliciting supported methods from the server with an HTTP OPTIONS request header, and then, upon “approval” from the server, sending the actual request with the actual HTTP request method. Servers can also notify clients whether “credentials” (including Cookies and HTTP Authentication data) should be sent with requests.
see : http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

HomeBrew install on Mac

 Command to run in terminal: ruby -e “$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)”

Error :dynamic-161-144-164-168:~ khematar$ ruby -e “$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)”
curl: (7) couldn’t connect to host

Resolution:
 you should add this to your bash profile (~/.bash_profile):HTTP_PROXY=”http://wwwproxy.ms.com:8080″http_proxy=”http://wwwproxy.ms.com:8080″HTTPS_PROXY=”http://wwwproxy.ms.com:8080″https_proxy=”http://wwwproxy.ms.com:8080″no_proxy=”localhost,127.0.0.0″}
  create the file if it doesn’t exists, once you finish you need to restart the terminal for the changes to take effect
  you see those lines if you run “env” on the terminal

  you can use any text editor to open it : ~/.bash_profile
  with vim would be: vi  ~/.bash_profile but if you’re not familiar with vi you should use apple’s textedit
  from the applications menu

Node REPL

Node REPL

Stop : ^C
node
.break

curl <url>
curl -i <url> // inspect resonse

http connecytion : keep alive is by default…so that new TCP connection needn’t be created for subsequent requests

http connecytion :  is transfer-encoding chunked which means streaming…as we cannot give content length here
SOURCE :Introduction to Node.js with Ryan Dahl – YouTube

use apache bend ab to make cuncorrent connectiuons for stress testing

which npm