I am using a js stave plugin called abcjs from github,It uses XmlHttpRequest to request the soundfont file on the remote server, means it uses "Http protocol" to access online soundfont file. The author of the plugin said that the soundfont file can be used locally, I download and copy it to xui.DefaultFolder,means it is "File protocal", so it always shows cross-domain errors. How to build a local http server and set xui.DefaultFolder as the root directory? because all the files are under this directory.The entire XmlHttpRequest process is written in the js plugin, I can’t modify it, all I can do is provide a URL address, like
http://127.0.0.1:3000/xui.DefaultFolder.
I have seen the thread of "
Embed an Http Server in your Android Application",but I don't know how to use it in my app.
I can use the following methods on the computer,and it succeeded:
E:\TEST\CIDES>http-server
Starting up http-server, serving ./
Available on:
http://192.168.0.100:8080
http://127.0.0.1:8080
Hit CTRL-C to stop the server