<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: starting with javascript sdk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/starting-with-javascript-sdk/m-p/85810#M1220</link>
    <description>&lt;P&gt;Hi Shachar,&lt;BR /&gt;
By default, browsers don’t allow cross origin communication (&lt;A href="http://en.wikipedia.org/wiki/Same_origin_policy"&gt;http://en.wikipedia.org/wiki/Same_origin_policy&lt;/A&gt;). I suggest that you follow an approach similar to what is in the UI examples that are shipped with the Splunk SDK for JavaScript, i.e. go through a proxy - &lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.ProxyHttp( "/proxy" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;In addition to that, since your webserver is different from where Splunk is running, you will also need to tell your web server to handle these proxy requests and delegate them to the right address, i.e. Splunk’s management port.&lt;/P&gt;

&lt;P&gt;For Apache, adding these 2 lines to httpd.conf does the trick.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
SSLProxyEngine On&lt;BR /&gt;
ProxyPass   /proxy/             &lt;A href="https://localhost:8089/"&gt;https://localhost:8089/&lt;/A&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
You will have to do something similar to your web server’s conf. Make sure to put the right host and port depending on your splunk configuration.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Sat, 12 Jan 2013 20:05:20 GMT</pubDate>
    <dc:creator>Neeraj_Luthra</dc:creator>
    <dc:date>2013-01-12T20:05:20Z</dc:date>
    <item>
      <title>starting with javascript sdk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/starting-with-javascript-sdk/m-p/85809#M1219</link>
      <description>&lt;P&gt;Dear Experts,&lt;BR /&gt;
I am need to demo very simple chart of Splunk as part of my web site.&lt;BR /&gt;
As I am not Javascript expert I am getting some error.&lt;/P&gt;

&lt;P&gt;If i need to connect from my web server do I need the :&lt;/P&gt;

&lt;P&gt;var http = new splunkjs.ProxyHttp("/proxy");&lt;/P&gt;

&lt;P&gt;the error that i am getting is &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;POST &lt;A href="http://localhost:58810/proxy/services/auth/login?output_mode=json"&gt;http://localhost:58810/proxy/services/auth/login?output_mode=json&lt;/A&gt; 404 (Not Found) jquery.min.js:4&lt;/LI&gt;
&lt;LI&gt;List item&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Can any once send me working sample ? for external web server.&lt;/P&gt;

&lt;P&gt;Many Thanks,&lt;BR /&gt;
Shachar&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2013 19:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/starting-with-javascript-sdk/m-p/85809#M1219</guid>
      <dc:creator>sbobrovs</dc:creator>
      <dc:date>2013-01-12T19:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: starting with javascript sdk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/starting-with-javascript-sdk/m-p/85810#M1220</link>
      <description>&lt;P&gt;Hi Shachar,&lt;BR /&gt;
By default, browsers don’t allow cross origin communication (&lt;A href="http://en.wikipedia.org/wiki/Same_origin_policy"&gt;http://en.wikipedia.org/wiki/Same_origin_policy&lt;/A&gt;). I suggest that you follow an approach similar to what is in the UI examples that are shipped with the Splunk SDK for JavaScript, i.e. go through a proxy - &lt;PRE&gt;&lt;CODE&gt;var http = new splunkjs.ProxyHttp( "/proxy" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;In addition to that, since your webserver is different from where Splunk is running, you will also need to tell your web server to handle these proxy requests and delegate them to the right address, i.e. Splunk’s management port.&lt;/P&gt;

&lt;P&gt;For Apache, adding these 2 lines to httpd.conf does the trick.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
SSLProxyEngine On&lt;BR /&gt;
ProxyPass   /proxy/             &lt;A href="https://localhost:8089/"&gt;https://localhost:8089/&lt;/A&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
You will have to do something similar to your web server’s conf. Make sure to put the right host and port depending on your splunk configuration.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2013 20:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/starting-with-javascript-sdk/m-p/85810#M1220</guid>
      <dc:creator>Neeraj_Luthra</dc:creator>
      <dc:date>2013-01-12T20:05:20Z</dc:date>
    </item>
  </channel>
</rss>

