2 Replies Latest reply on Feb 15, 2009 10:28 PM by andin

    Remoting Destination Port Problem

    andin

      Hi,


      I'm trying to use remoting to access Seam Components (port 8080) in an ordinary, apache served .html (port 80).


      The Problem is, that the AJAX Request is directed to localhost/xyz, instead of localhost:8080. Rewriting the destination by hand, using a security proxy like paros, it works like a charme! I can't find any place to set up the right port. Theoretically, this will work without setting up a port by just sending the request from where the script comes from, but my javascript capabilities are to limited to tackle down the right place...


      Any hints will by appreciated...


      <script type="text/javascript" src="http://localhost:8080/xyz/seam/resource/remoting/resource/remote.js"></script>
      
      <script type="text/javascript"
      
              src="http://localhost:8080/xyz/seam/resource/remoting/interface.js?PriceSheetObtainmentRequestAction"></script>
      
      
      <script type="text/javascript">
      
        //<![CDATA[
      
        function getStatus() {
      
          Seam.Component.getInstance("PriceSheetObtainmentRequestAction").getPriceSheetStatus(1234, sayHelloCallback);
      
        }
      
      
        function sayHelloCallback(result) {
      
          alert(result);
      
        }
      
         // ]]>
      
      </script>
      


        • 1. Re: Remoting Destination Port Problem
          andin

          Hmmm. stupid me.


          The Same Origin Policy is effectivly blocking my efforts...


          Why am a doing such stuff? I wan't to get some new information in a legacy app, without messing with its code.


          Maybe I try with apache acting as a proxy...

          • 2. Re: Remoting Destination Port Problem
            andin

            I love this stuff!



            Enable Proxy for apache2


            a2enmod proxy
            a2enmod  proxy_http
            
            



            setup site:


            <VirtualHost *:80>
            
                 ProxyPreserveHost on
            
                 <Location /xyz>
                      ProxyPass       http://127.0.0.1:8081/xyz
                      ProxyPassReverse    http://127.0.0.1:8081/xyz
                      Order allow,deny
                      allow from all
            </Location>
            



            server/default/deploy/jboss-web.deployer/server.xml


            <Connector protocol="HTTP/1.1" port="8081" 
                   address="${jboss.bind.address}"  
                   enableLookups="false"  
                   connectionTimeout="20000" 
                   redirectPort="8443" 
                   proxyName="yourhostnamehere" 
                   proxyPort="80" />
            
            



            This does the trick for a local setup. Nice!