读取请求标头

On server side: I have a response file that sets the appropriate response headers, etc (all in js).

On client side: I make a cross-domain $.ajax request, and get a JSON response back.

All works well. But what I want to do is, on the server side, everytime a client makes a request, check the client's origin header and get that value.

How can I do this in JS?

You have said you need it on the server side so why do you want to make in JS ( client side ) ? Can't you just use PHP or something?