_*I am behind proxy  and  i tried to  decode *JSON* encoded  script behind

I am behind proxy  and  i tried to  decode JSON* encoded script behind proxy, Using curl i read the url and then feed that to JSON_DECODE but this is giving*
invalid argument or error at JSON_DECODE can u expalin any solution?
<?php
session_start();
require_once('JSON.phps');
$url = 'http://ajax.googleapis.com/ajax/services/search/web?rsz=large&v=1.0&q=' . urlencode('site:' . $_SERVER['localhost'] . ' ' . $_POST['searchquery']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_PROXY, "172.31.1.1");
curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "myid:myPASS");
curl_setopt($ch, CURLOPT_URL, $url);
$body = curl_exec($ch) or die(curl_error($ch));
curl_close($ch);
$json = new Services_JSON();
$json = $json->decode($body);   //Giving error at this point as INVALID ARGUMENT
foreach($json->responseData->results as $searchresult)
if($searchresult->GsearchResultClass == 'GwebSearch')
$formattedresults .= '
<div class="searchresult">
<h3><a href="' . $searchresult->unescapedUrl . '">' . $searchresult->titleNoFormatting . '</a></h3>
<p class="resultdesc">' . $searchresult->content . '</p>
<p class="resulturl">' . $searchresult->visibleUrl . '</p>
</div>';
$_SESSION['googleresults'] = $formattedresults;
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
?>

This is a Java forum. Your script appears to be written in PHP.
Please note that Javascript and Java are unrelated.

Similar Messages

  • Connection Problem while client is behind proxy and server out side proxy

    hello
    i implemented ChatApplication in JAVA, for that i used socket connection when client and server both are in same network then it's working fine.
    but when my server is on internate and client is behind proxy and try to connect with server
    it not able to connect i get exception.
    i serch most of forum i got same answer and i try it but i was not success.
    any kind of help is appriciated.
    i attached my code(which i implement for testing ) pls reply me
    thanks in advance.
    Server.java
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    class Server {
       public static void main(String args[]) {
          String data = "you are successfully connected with server.";
          try {
             ServerSocket srvs = new ServerSocket(1234);
             Socket skt = srvs.accept();
             System.out.print("Server has connected!\n");
             PrintWriter out = new PrintWriter(skt.getOutputStream(), true);
             System.out.print("Sending string: '" + data + "\n");
             out.print(data);
             out.close();
             skt.close();
             srvs.close();
          catch(Exception e) {
             System.out.print("Whoops! It didn't work!\n");
    ProxyClient.java
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class ProxyClient{
       public static void main(String args[]) {
         String host="61.17.212.29";
         int port=1234;
               String line;
         Properties properties = System.getProperties();
         /*properties.put("firewallSet", "true");
         properties.put("firewallHost", "192.168.0.1");
         properties.put("firewallPort", "808");*/
         properties.put("socksProxySet","true");
         properties.put("socksProxyHost", "192.168.0.1");
         properties.put("socksProxyPort", "1080");
         System.setProperties (properties);
         try {
         /*SocketAddress addr = new InetSocketAddress("192.168.0.1", 1080);
         Proxy proxy = new Proxy(Proxy.Type.SOCKS, addr);
         Socket skt = new Socket(proxy);
         InetSocketAddress dest = new InetSocketAddress("61.17.212.29",1234);
         skt.connect(dest);*/
             System.out.println("before socket taken");
             Socket skt = new Socket(host,port);
             System.out.println("after socket taken");
             BufferedReader networkBin = new BufferedReader(new InputStreamReader(skt.getInputStream()));
             System.out.println("Received string: '");
             line = networkBin.readLine();     // Read one line
          while(true)
                 System.out.println(line);     // Output the line
                 line = networkBin.readLine(); // Read the next line, if any
          catch(Exception e) {
             System.out.print("Whoops! It didn't work!\n");
         e.printStackTrace();
    }

    Now look here. I could not care less about this
    code. I don't know anything about it, I don't
    want to know, I have already recommended you don't
    use it, and I have also given you a simpler and
    better solution. If you don't want to take my advice
    that is your privilege and your problem.ya i has understand system propertis i have setted and u can see it in the code i have tried by both system properties and also J2SE 5.0 proxy class but i got a same problem malformed Exception server refuse to connection.
    is there any problem at sever side?
    can u tell me in which way u r teling to set the propery i m looking forward for ur reply.
    ya i m sure u will give me.................reply "ejp".
    Thnx in advance.

  • Xinclude behind proxy

    Hi,
    I need to parse an XML file which has xinclude e.g.:
    <xi:include href="http://www.something.com/xml/document.xml"/>
    I use the SAX parser. The problem is that the parser runs on a network behind a proxy so the parser times out while trying to connect to the href location. Is there a way of passing the proxy address to the parser or other parser to open a connection via the proxy and not directly?
    Thank you very much.

    Here's a document that explains how to get Java to work with your proxy server:
    http://java.sun.com/j2se/1.5.0/docs/guide/net/proxies.html

  • Calling setPage of JEditorPane from behind proxy

    hi
    I have a peculiar problem...
    I am trying to make a small tool....a small java browser kind of a thing...
    I am behind a proxy and so when I call setPage on the jeditorpane it gives 407 error ie.Proxy authentication required.
    Now I know how to do it through a URLConnection by setting the Reuest property...But how to do it in this case....
    Just putting http.proxyUser and http.proxyPassword in System properties is not working...
    Please help

    TRY WITH java.net API
    THERE ARE SOME METHODS TO WORK WITH PROXIES.
    HOW EVER YOU SHOULD NEED AUTHRIZATION LEVEL TO GO OVER YOUR PROXY SERVER.
    MEANS YOU SHOULD HAVE A PASSWORD

  • Empathy longstanding issue behind proxy

    There is a longstanding issue of empathy (or telepathy-gabble) behind proxy.
    I have tried to get solutions for years. Here is the description:
    Settings:
    * I am behind a proxy.
    * I have set the system proxy settings and http_proxy/socks_proxy in the environment.
    * The latest version of empathy (3.12.1)
    Issue:
    I use empathy to login GTalk account. The authentication worked fine. However, there is
    an error "Network error" showing in the dialog. This happened before displaying
    my contacts. I googled this issue and found that something wrong with telepathy-gabble.
    So, I abandoned empathy for a long time.
    But, recently, I use a newly registered google account to login GTalk with empathy.
    Everything is well. I can chat with others. Still, I cannot login with my old account.
    This seems wired. I asked others to try their accounts, some of them can login without problem
    and some still have problem.
    For years, I can only use GMail in the browser to access my gtalk. I know this is about
    empathy rather than Arch Linux. But, I like this community and believe someone could help me.

    Hello Enrique,
    I fully agree - but unfortunately there is not much choice regarding the network layout. Or at least I cannot influence it ;-P
    The problem seems to be a bit mor subtle than I thought at first. I already have configured both Web Start and the browser to use the proxy. However, the error message clearly indicates that the integration builder (IB) doesn't use the configured port of the proxy to connect to the web application server, but another port.
    Our server listens on port 50000. The error message tells me that the IB tries to connect using port 50004. Obviousely it tries to open a direct socket to the server - probably an extra connection to exchange commands etc (RMI? CORBA? WebServices?). This is not possible in our network configuration.
    The question ist whether I can somehow influence this port to make a connection using this proxy possible...
    Regards, Joerg

  • 1.0.3.101.gbfa97dfe Release: Still No Images Behind Proxy

    I've searched for an update to this issue, but there doesn't seem to be a verified solution beyond downgrading the app.The standing issue is that I'm unable to see any images behind my work proxy. We have both an http and and https prox. Neither require a username or password login. Prior to the 1.0.3 update I was able to see all album and user images. my prefs look like this:app.autostart-banner-seen=true
    core.flash_version=16
    autologin.username="someuser"
    network.proxy.addr="http.proxy.somecompany.com:1234@https"
    autologin.blob="a blob"
    autologin.canonical_username="someuser"
    language="en"
    network.proxy.mode=2
    core.clock_delta=0 I've tried installing and uninstalling Spotify. Mostly I just want to verify that this is a known issue and it's being worked on.

    Over 8 months since this thread was opened. There are NUMEROUS threads on this issue and none have a community advocating giving any indication that Spotify even acknowledges this is an issue. It's nearly impossible to debug this problem since all the code in the App Package is obfuscated. Here's what I know:If I disconnect from the proxy and remove any reference to the proxy I get picturesAny pictures that are downloaded while "off proxy" are cached and they show up normally in the app once I'm back on the proxyRemoving network.proxy.addr from the "prefs" file but leaving "network.proxy.mode=2" while off proxy will prevent me from downloading imagesChanging "network.proxy.mode=2" to 1 while off proxy allows me to download imagesI don't get any meaningful errors in my console, but from time to time "Spotify Helper" shows upHonestly, none of should be surprising. I can't do any more troubleshooting on my end. Was hoping a Community Advocate (familiar with the issue) would weigh in.

  • Connection configuration properties behind proxy

    I'm trying to reach a web service registry from behind proxy. In order to connect to it I'm setting it's address and port using
    props.setProperty("javax.xml.registry.http.proxyHost", httpProxyHost);
    props.setProperty("javax.xml.registry.http.proxyPort", httpProxyPort);
    but getting HTTP 407 error - Proxy Authentication Required. I believe I need to set my proxy ID and password somehow. Dos anyone know how to do that? Any advice is greatly appreciated.
    Michael D.

    First, what API has the "javax.xml.registry" in it. I cant find any reference to it. I could have missed it I suppose. Let me know and I will take a look.
    Other ideas after looking at your code that you can try in the meantime.
    Since the Properties class is a hashtable it is based on key word value. The ConnectionFactory class needs to know the exact key.
    Try changing the following:
    props.setProperty("javax.xml.registry.http.proxySet", "true");
    to:
    props.setProperty("proxySet", "true");
    Do that for each line. Just use the last word (i.e. proxyHost, proxyPort). It could simply be that ConnectionFactory is not finding the correct key.
    I could be wrong here, but I am waiting to find out what API you are using.
    The SoapHTTPConnection class has a number of methods for working with a proxy, such as setPassword and setHost. Perhaps ConnectionFactory has the same settings or the connection returned has methods for this.
    Im not sure what class the createConnection method returns, but check there for appropriate methods.

  • TS4268 I have apple ID and when trying to sign in to use FaceTime,i always get registration error.how may you help me for that guys,thanks.

    I have apple ID and when trying to sign in to use FaceTime,I always get error in registration,(This words always apper; The server encountered an error processing registration.Please try again later.)
    Can I get your Advise on what to do? Thanks

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    iOS: FaceTime is 'Unable to verify email because it is in use'
    http://support.apple.com/kb/TS3510
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    How to Set Up & Use iMessage on iPhone, iPad, & iPod touch with iOS
    http://osxdaily.com/2011/10/18/set-up-imessage-on-iphone-ipad-ipod-touch-with-io s-5/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Troubleshooting iMessage Issues: Some Useful Tips You Should Try
    http://www.igeeksblog.com/troubleshooting-imessage-issues/
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    How to Block Someone on FaceTime
    http://www.ehow.com/how_10033185_block-someone-facetime.html
    My Facetime Doesn't Ring
    https://discussions.apple.com/message/19087457
    To send messages to non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
    You can check the status of the FaceTime/iMessage servers at this link.
    http://www.apple.com/support/systemstatus/
     Cheers, Tom

  • Web service proxy and security constraint

    I've placed a security constraint on my web service and set the login-config auth-method as BASIC. When I run the Workshop test and the (Test View) browser begins to appear I am prompted for my username and password since it is protected --- great, it's working.
    Here's my problem, when I create the Java Proxy and try to access the web service using the proxy in another application I am never prompted for my username and password and thus the request fails. Anyway to fix this so I can be promted using the proxy??
    thanks in advance,
    Steve Touw

    Hi Shay Shmeltzer,
    Thanks for the reply.
    I tried in HTTP Analyzer in JDeveloper and there also it is not working. My concern is :-
    There are many other web services deployed on the same SOA server in same partition and they are working fine in HTTP analyzer and I am able to create and use the web service proxy as well. So as per my understanding there is nothing like network issues between SOA server and jDeveloper.
    1 more thing When I am creating the proxy for this web service and requesting from the proxy's main method SOA is getting proper input (which I am providing in the main method) and SOA is returning proper output I have checked the SOA instance in em. So there is no problem in SOA side. The problem is jDeveloper is not able to get back that response which SOA is returning.
    Please Help.
    -- NavinK

  • My early 2011 MBP 13" does not recognize my Sandisk 16GB 45MB/s Extreme Pro SDHC card.  I went to the Genius Bar and we tried it in all the MacBook Pro's in the Apple Store and NONE could recognize the card.  However, iMacs did.  Any suggestions?

    My early 2011 MBP 13" does not recognize my Sandisk 16GB 45MB/s Extreme Pro SDHC card.  I went to the Genius Bar and we tried it in all the MacBook Pro's in the Apple Store and NONE could recognize the card.  However, iMacs did.  Any suggestions?  Genius behind the Bar suggested wait for LION OS X release...

    You really don't need to post multiple times, you will get attention eventually.
    Find the reply here:
    MacBook Pro 13 (MBP 8,1 random restarts)

  • I just updated my macbook pro to 10.6 and I tried to update iphoto and it said i needed  10.7 or later and checked and computer says i have the most up to date softwear

    i just updated my mac book to 10.6 says its the latest update and i tried to update iphoto and says i need 10.7 but my compture says 10.6 is the most up to date.  Help

    Software, as in applications, maybe. Software as in Operating System, heck no. We're now at 10.8 level, you're two levels behind. Latest iPhoto, as in v9.3.2, is part of iLife'11 and needs a minimum of Lion 10.7 to run.
    Since Mountain Lion 10.8 came out, Apple has dropped support for Snow Leopard 10.7, since they only maintain the latest two versions of the OS. So you will be seeing more and more of these "unupgradeable upgrades" in the coming days.

  • [Win7 Spotify v1] no connection behind proxy

    I can login to my premium account and that's it. No music playback. Actually nothing displays on the left to playlist. You need to wait  a few minutes for preferences to displays after pressing Ctrl-P
    I have tried completly uninstall  and clear windows registries with Revo Unistaller tool and install application back.
    After observing that the option file (d:\userdata\xxxx\Application Data\Spotify\prefs) keep groving infinitely with exact copies of line entries I give up and reverted to 0.9 version and blocked auto update with help of an excelent how-to found on the forum.
    BTW: Discountinuation of apps support is a *huge* downgrade for me.
    Personally I don't care about friends activity, but I frequently use:
    Last.fm
    h1tchr
    BBC Playlister
    and suprise suprise musicXmatch
    As for classical music records search is still a miss and hit process I rely on labels apps like:
    harmonia mundi 
    DECCA
    The Legacy Of
    My understanding is that equalify doesn't support version 1.0 of Spotify.
    > Equalify does not support the Spotify 1.0.x BETA client at this time.
    (http://www.equalify.me/?page=download)
     

    Same problem, unable to connect via proxy and preference screen doesn't pop up at all.
    Agree with you on the friends activity feed, don't mind it but it isn't important.
    I am a bit worried about the "Messages" Icon since I don't want spotify to be anything other than a tool to play music.
    I definetly don't want spotify to become a swiss army knife kind of app.

  • WebService Proxy and x509 cert. authentication

    Does anybody know if JDeveloper 10.1.3 generated WebService proxy by default is trying to use wallet other then keystore?
    We have generated a web service proxy and trying to make a call to a WebService over SSL to the site which require x509 certificate.
    Setting up keystore properties like :
    System.setProperty("javax.net.ssl.keyStore","c://temp//keystore/myKeystore.jks");
    System.setProperty("javax.net.ssl.keyStorePassword","password");
    does not have any affect. And debug shows the following:
    {Thread-10} [1:42:59.187] URLC: (https:twss.trac2es.transcom.mil:443) Connecting ...
    {Thread-10} [1:42:59.187] Conn: Creating Socket: twss.trac2es.transcom.mil:443
    {Thread-10} [1:42:59.328] Conn: using SSL version Oracle
    {Thread-10} [1:42:59.390] Using wallet:
    {Thread-10} [1:42:59.437] Conn:
    And then shows the errors:
    {Thread-10} [1:42:59.437] Unable to connect to URL: https://twss.trac2es.transcom.mil/trac2es-pmr/WebServicePmrSoapHttpPort due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: javax.net.ssl.SSLException: SSL handshake failed: SSLSessionNotFoundErr
    Any help will be apreciated
    Alex

    Bruce,
    We are trying to setup X509 Client Cert to involve CAC(Smart Card) processing as a part of the initial part of our Jdev 10 or 11g app utilizing jsf/toplink. We are running OAS 10.1.2.0.2 presently but we can move to OAS 10.1.3 or OAS 10.1.4 without any problem.
    I am hearing a lot of references to Jdev and creating the WebService.
    Do you know if I am better off using what comes with OAS for the authentication or using Jdeveloper? If there is any good document you can refer me to we'll greatly appreciate it.
    Thank you in advance for your response.

  • Newbie: Trying to get data  from Code Behind file to HTML file.

    Greetings,
    I am trying to use the opener link adaptive tag to open a specific page. I have the Object ID, and classID as variables in my class in my class file, but I do not know how to get that data into the opener link which is on the html page.
    Should I be using session variables? If so how, I am a newbie.
    Does anyone know how?
    Thanks.

    Kinda depends on your flavor/need/preference. I've done it...
    * Using session variables and just writing to the page in script blocks. Not preferred in .NET-land, but definitely more of the fast/traditional ASP style. Use sparingly and with caution. Be really careful about VS.NET totally destroying your tags. It seems to love doing that (as an aside - HUGE thank-yous to the BEA engineers who altered the tags to consistenly use lower case. Really. I can't thank you enough. :) )
    * Using label controls and then just populating the label with the formatted adaptive tag (this can work well)
    * One of our guys did a really simple/elegant server control that takes arguments for the objectid, classid, etc. Nice for creating things repeatedly server-side and gets you by the HTML, quotes, etc. all over the place. Nice as it also consolidates the tag in a single place you can alter once.
    For session variables, you'd just do something like...
    <%
    '//in your code-behind
    Session("myClassID") = 18
    Session("myObjectID") = 12345
    %>
    <!-- in your aspx file -->
    <pt:standard.openerlink xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/' pt:objectid='<%=Session("myObjectID")%>' pt:classid='<%=Session("myClassID")%>' pt:mode='2' target='myWindow' onclick=window.top.open('','myWindow','height=800,width=700,status=no,toolbar=no,menubar=no, location=no');>Adaptive Tags Made This Easy - Click to Open My Awesome Document</pt:standard.openerlink>
    That help?
    Personal style, I would try to avoid using session, etc. directly on your ASPX file. I'd go with writing out the HTML through labels, data lists, etc. in your code-behind.
    Thanks,
    Eric

  • RWS.Proxy and ECP.Proxy health checks, localhost, and SSL

    RWS.Proxy and ECP.Proxy health sets are both failing. In both of the errors, I find the following:
    [000.000] Starting HTTP request task
    [000.000] Waiting 59000 ms
    [000.000] Issuing GET against https://localhost/ecp/
    [000.000] Awaiting GET response
    [000.000] Performing SSL validation
    [000.000] Performing SSL validation
    [000.000] Failed with exception: The underlying connection was closed: An unexpected error occurred on a receive.
    [000.000] Starting HTTP request task
    [000.000] Waiting 59000 ms
    [000.000] Issuing GET against https://localhost/ecp/ReportingWebService/
    [000.000] Awaiting GET response
    [000.000] Performing SSL validation
    [000.000] Performing SSL validation
    [000.000] Failed with exception: The underlying connection was closed: An unexpected error occurred on a receive.
    We require SSL on all connections. We use a third party certificate with multiple SANs. Since the probe is trying to use https://localhost, it fails because the name doesn't match.
    I figure I have a few options: first, is there a way to change the URL that the probe uses to check. This seems to me to be the 'rightest' way I could fix this. Second could I alter the binding of the site so that the localhost hostname uses a dedicated,
    self signed, trusted cert? Last, is there any way to simply disable the specific probes? We're a single server low volume setup and I'm not convinced that I need the probes anyway.
    IS this a common issue? Outside of the warnings that SCOM throws at me, it is also causing a large volume of logs to be generated.
    Justin Cervero - MS Enterprise Admin - Appalachian State University

    Hi,
    I am afraid it’s hard coded. Just like the “Test-Outlookwebsiervices” command, it will also try the “localhost” and reports errors about certificate host name mismatch issue.
    We can safely ignore this report.
    Thanks,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

Maybe you are looking for

  • SSO to My application!!!

    hi all,      how can I implement SSO from portal to my application?      portal:EP6.0(inside netweaver SP15).      my application: It's writed in JSP and JAVA. It has been deployed on the SAP web application server and the database is oracle.      I

  • When I connect my Iphone 4 to my computer I no longer get the option to move photos from iphone to computer. also i do not think my driver is operating. what to do?

    When I connect my iphone four to my computer I no longer get the option to load photos from phone to computer.  I think i have a driver problem as well. What should I do?

  • Can't uninstall AMD Catalyst Install Manager

    I'm trying to fully uninstall the drivers and Catalyst for my MSI R7870 series in hopes to reinstall and get the thing working correctly. I run the uninstall manager through programs and features and get stopped with the following error message: "Win

  • Different ways to create an object

    Hi All, I am a new bie to java programming. I know the way to create an object for a class will be something like A b = new A(); // A is the class name and b is the object name. But i am not sure what the following code means, I know it is also creat

  • Errors with PDF documents

    Hi, I'm having trouble with some PDFs for work. They have small images of keypad buttons. They display fine on the PC, but on my iPhone 4 they just show a black box for each image. Here's a link to one of the smaller manuals that has this issue (chec