Security

By-pass proxy service for javascript sdk

mohitab
Path Finder

I tried to browse the same web page as http://answers.splunk.com/answers/55188/sdk-javascript-client-side-test-error-404.html. And Getting the same error.

I am looking for a way to bypass /proxy service ( which is supposed to be run by node.js).

In the client's js code:

 var http = new splunkjs.ProxyHttp("/proxy");

         // Create a Service instance and log in 
         var service = new splunkjs.Service(http, {
             username: "admin",
             password: "admin",
             scheme: "https",
             host: "localhost",
            port: "8089"
     });

I am looking for a way to create http object that does not rely on /proxy service to be run on my webserver. I could not find any way from the API documentation. Any help on how I can avoid creation of proxy service on my server and connect directly with splunk. I have a constraint of using a non-nodejs server. Does JS SDK allows that?

Tags (2)
0 Karma

kkatzgraukeyw
Explorer

So, by digging around in the splunkjs source, I found you can also do this:

var http = new splunkjs.JQueryHttp();

Sure wish it was documented though!

jawaharas
Motivator

Thank you.. It worked for me.

0 Karma

mohitab
Path Finder

I figured out that the JS SDK for splunk creates a necessity of using /proxy service. Finally I did not use splunk SDK and worked out with basic Angular/JQuery.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...