5

I wonder if there are many servers that are supporting CORS?

ajsie
  • 77,632
  • 106
  • 276
  • 381
  • 1
    Can you clarify what you mean with "servers"? Do you mean specific implementations of CORS, or do you mean server software (such as Apache) that can be configured for CORS? For the former, Wikipedia has a list of web services that support CORS: http://en.wikipedia.org/wiki/List_of_Web_services_allowing_access_from_any_origin – monsur Feb 10 '11 at 05:52

3 Answers3

8

To make your web server support CORS, it is as easy as making it return another header.

For example, in Apache2, simply add this line to your applicable conf file:

Header set Access-Control-Allow-Origin "*"

To be more secure (or if you don't have access to your server's conf file) you might want to NOT add this header in your server, but only add it with your server-side code when you really want it there.

For example in PHP you could do this: (untested)

<? header('Access-Control-Allow-Origin "*"'); ?>

Magmatic
  • 1,754
  • 3
  • 19
  • 34
2

Tomcat users can use the CORS Filter

Adam B
  • 1,724
  • 3
  • 14
  • 29
0

You can find here a simple implementation of a Python 2.7 server supporting CORS

Bastien
  • 901
  • 1
  • 7
  • 7