Sgvizler has moved to github. This site and its repository will no longer be maintained.

Sgvizler FAQ

Browser support, Same origin policy, Cross-Origin Resource Sharing

This section is moved to Compatibility.

Enabling CORS on Joseki

Joseki has not enabled CORS ( Read more in this thread.), but it is quite easy to do so. Find the file org/joseki/http/ and the method output, and add the line marked // INSERT in the code block below.

private void output(String contentType, String charset, OutputContent proc)  throws IOException
        ser.setHttpResponse(httpRequest, httpResponse, contentType, charset);  
        httpResponse.setStatus(HttpServletResponse.SC_OK) ;
        httpResponse.setHeader(Joseki.httpHeaderField, Joseki.httpHeaderValue);
        httpResponse.setHeader("Access-Control-Allow-Origin", "*");              // INSERT
        ServletOutputStream out = httpResponse.getOutputStream() ;
        proc.output(out) ;
        out.flush() ;

I have done this with the current latest version of Joseki, 3.4.4; the jar file is available in the download section. Replace the joseki-3.4.4.jar file in the lib folder with this file should do the trick.


A workaround is to set up a proxy for your endpoint; php seems to be a popular language for this.