misantronic

New Members
  • Posts

    1
  • Joined

  • Last visited

misantronic's Achievements

New User

New User (1/3)

  1. I am facing the same issue. Is there no way to actually set the headers for btsync to enable cross-domain-requests? I'm trying to access the API on my localhost:8888 via angular.js XMLHttpRequest cannot load http://localhost:8888/api/v2/folders.'>http://localhost:8888/api/v2/folders. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 401.EDIT: So I just added mod_proxy to my apache webserver and added a new site: <VirtualHost *:80> ProxyPreserveHost On #ProxyRequests Off ServerName btsync.localhost #ServerAlias btsync.localhost ProxyPass / http://localhost:8888/ ProxyPassReverse / http://localhost:8888/ Header set Access-Control-Allow-Origin "*"</VirtualHost> I set the Access-Control-Allow-Origin to * in this so I can acually access btsync.localhost from anywhere. This works. Another problem that I have is, that I cannot send the Basic Auth credentials via the Ajax-Request. They're alway rejected. I do something like this: $http.defaults.headers.common.Authorization = 'Basic '+ btoa('user:password');$http.get('http://btsync.localhost/api/v2/folders')He actually adds the users credentials to the header but I still get an error: XMLHttpRequest cannot load http://btsync.localhost/api/v2/folders. Invalid HTTP status code 401