0

I wrote a client-side in an existing server-side project.

I ran both on localhost

How come I get Cross origin requests are only supported for protocol schemes error?

server:

localhost:8880/SupporTool/Push/SelectMessagesAttributes.

client:

http://localhost:63342/SupporTool/SupporTool_main/webapp/html/angular2/index.html?_ijt=5qo5v38f4p20oac99ca4jcgdi0

enter image description here

Elad Benda
  • 35,076
  • 87
  • 265
  • 471

1 Answers1

1

A different port is already treated as different domain. Either you serve on the same port or you configure the server to send CORS headers for client requests.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • still happens even thought same host and port http://stackoverflow.com/questions/39019403/client-from-localhost8880-calls-server-from-localhost8880-but-gets-cross-origi – Elad Benda Aug 18 '16 at 13:25