14 Replies Latest reply on Oct 28, 2009 4:50 AM by Kishan M V

    HTTPService Gumbo sandbox violation

    VincentVega_

      Hello! I am developing an application with Flash builder 4, had previously used flex 3. This development is beginning to turn into a nightmare.

       

      I use the HTTPService to access PHP, these files are hosted on the same server where the swf is stored:

       

      >> index.html
      >> test.swf
      >> / php
          >> test.php

       

      http://localhost/index.html When I connect to the server, everything works fine, but when I access the IP address
      http://192.168.100.150/index.html throws an error in the sandbox

       

      *** Security Sandbox Violation ***
      It has stopped http://localhost:37813/php/test.php?hostport=192.168.100.50&https=N&id=0BF00C73-D9CF-FD2C- 7584-90F82C24F02C connection - not permitted from http://192.168.100.50 / index.swf

       

      All requests are made by an absolute address with the hostname.
      if the IP address:
      myhttp.url = 'http://192.168.100.50/php/test.php';
      In case of localhost:
      myhttp.url = 'http://localhost/php/test.php';

       

      I tried with the policies and crossdomain.xml but nothing works, why local searches if I have not specified?

       

      I read another threads but nothing.

       

      Thanks

        • 1. Re: HTTPService Gumbo sandbox violation
          SrinivasAnnam Adobe Employee

          Hi,

           

             Could you please disable the Network Monitor and execute the project once to see if it still occurs.

           

             You can go to "Network Monitor" pane and click on the "Monitor with Stop" icon to disable the monitor.

           

              If that works for you, then we can log a bug on Network Monitor and fix it for you.

           

          Thanks,

          Srinivas Annam - Adobe

          http://srinivasannam.wordpress.com

          • 2. Re: HTTPService Gumbo sandbox violation
            VincentVega_ Level 1

            Thanks Srinivas, without the network monitor all works great!!

             

            I must log the bug in the gumbo tracker?

             

            Thanks for your time!

            • 3. Re: HTTPService Gumbo sandbox violation
              Flex harUI Adobe Employee

              Even though localhost might map to the IP address 192.168.100.150, in Flash Security, they are not the same.  Crossdomain.xml should help if you set it up properly.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui

              • 4. Re: HTTPService Gumbo sandbox violation
                SrinivasAnnam Adobe Employee

                Glad to hear that you could workaround this bug.

                 

                Looks like this is a known issue which we re-opened yesterday http://bugs.adobe.com/jira/browse/FB-21099

                 

                Thanks,

                Srinivas Annam

                http://srinivasannam.wordpress.com

                • 5. Re: HTTPService Gumbo sandbox violation
                  NuppyChan

                  I have an Flex project that run fine when i debug or run it from Flash builder 4. I would like to host this app using Tomcat , so i copied the bin-debug files into my Tomcat Root directory. The application loads up correctly if i use the following URL:

                   

                  http://localhost:8080/

                   

                  The application uses HTTPService to get data  using the url http://localhost:8080/sbserv/getTableData

                   

                  Now the issue is if i try to access the application using my hostname i have some issues.

                   

                   

                  http://<hostname>:8080/

                   

                  I see that in my fiddler trace that it is trying to get the crossdomain.xml (which by the way is at the Tomcat Root)

                   

                  The crossdomain.xml has
                  <?xml version="1.0"?>
                  <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
                  <cross-domain-policy>
                  <allow-access-from domain="*" />
                  </cross-domain-policy>
                  I dont understand why it is looking for the crossdomain.xml at port 37813.
                  How do i make this work so that i can access the app using my hostname?
                  Thanks

                  • 6. Re: HTTPService Gumbo sandbox violation
                    t3hm4d0n3

                    I am having the exact same issue, i can connect to my remote server from my local machine just fine in the application however

                    when i upload the application to the remote server i get the errors:

                     

                    Warning: Domain www.mysite.com does not specify a meta-policy.  Applying default meta-policy 'master-only'.  This configuration is deprecated.  See http://www.adobe.com/go/strict_policy_files to fix this problem.

                     

                    Failed to load policy file from http://localhost:37813/crossdomain.xml

                     

                    this is my crossdomain.xml file

                    <?xml version="1.0"?>
                    <cross-domain-policy>
                            <allow-access-from domain="*" />
                    </cross-domain-policy>

                     

                    i am calling Security.loadpolicy from mx:application: initialize="Security.loadPolicyFile('http://www.helpmewithmywebsite.com/crossdomain.xml');"

                     

                    where does it say use localhost in flex 4? nowhere in any of my code does it say load anything using localhost, nor in the project properties anywhere i can see.

                     

                    any help would be greatly appreciated,

                    -=Levi=-

                     

                    On an aside i signed up on JIRA and have not recieved an activation email (this was a week ago) levidehaan is the username.

                    • 7. Re: HTTPService Gumbo sandbox violation
                      t3hm4d0n3 Level 1

                      Ahhh, well don't I feel sheepish.

                      All I needed to do was export as release build and now everything works...

                      Guess I should have read up more on the new features of 4.

                      I cant wait till this gets released so I can be the first kid on the block with the

                      cool stuff, thanks for freakin awesome programming stuff, it rocks!

                      • 8. Re: HTTPService Gumbo sandbox violation
                        sethrd11

                        I started get this error after upgrading from flash builder beta 1 to beta 2. Turning off the network monitor fixed it. I'm still unsure of the cause.


                        the cross domain in my project looks like this:

                        <cross-domain-policy>
                            <allow-access-from domain="*.myproject.com" />
                            <allow-access-from domain="*" />
                            <site-control permitted-cross-domain-policies="all"/>
                            <allow-http-request-headers-from domain="*" headers="*"/>
                        </cross-domain-policy>


                        but the cross domain that's getting picked (in Charles) at localhost:37813 is this

                        <cross-domain-policy>
                        <allow-access-from domain="*" to-ports="*"            />
                        <site-control permitted-cross-domain-policies="master-only"            />
                        </cross-domain-policy>

                        • 9. Re: HTTPService Gumbo sandbox violation
                          Kishan M V Adobe Employee

                          Hi,

                           

                          Can you please clean the project and enable the network monitor again and check if the sandbox violation error is still occurring?

                          Deleting the output folder which was created in beta1 will be better.

                          Please let us know the outcome of this test.

                           

                          Regards,

                          Kishan

                          • 10. Re: HTTPService Gumbo sandbox violation
                            MartyO

                            Try doing a release build - into any folder in www root! works for me :-)

                             

                            Project > Export Release Build

                             

                            Also check your server URL in the projects settings - always pays to check if you deploy away from localhost

                             

                            HTH

                            martin

                            • 11. Re: HTTPService Gumbo sandbox violation
                              scarenci

                              I Have de same problem localhost:37813 and cross domain is equals yours!!!

                               

                               

                              I dont known the problem too, Anybody known how to fix this!!

                               

                               

                               

                              appreciate any help!!

                              • 12. Re: HTTPService Gumbo sandbox violation
                                scarenci Level 1

                                I had not understood you, but now I see how works thanks

                                 

                                 

                                bye

                                • 13. Re: HTTPService Gumbo sandbox violation
                                  mdbrock

                                  I just had this problem after changing only one thing: the variable I was using was originally stored as a public member.  But as soon as I declared it [Bindable], I got the security sandbox error.  Nothing else changed.

                                   

                                  For example:

                                   

                                  <s:Application ... creationComplete="init()">


                                    import ...


                                    public var localURL:String;


                                    [Bindable]

                                    public var localBoundURL:String;


                                    protected function init():void {

                                      localURL = ExternalInterface.call("window.location.href.toString");

                                      localBoundURL = ExternalInterface.call("window.location.href.toString");

                                    }


                                    private function goodHandler(event:MouseEvent):void {

                                      var loader:URLLoader = new URLLoader();
                                      var request:URLRequest = new URLRequest(localURL);
                                      request.method = URLRequestMethod.POST;
                                      var variables:URLVariables = new URLVariables();
                                      variables.dummy = "";
                                      request.data = variables;
                                      loader.load(request);
                                    }


                                    private function securityExceptionHandler(event:MouseEvent):void {
                                      var loader:URLLoader = new URLLoader();
                                       var request:URLRequest = new URLRequest(
                                  localBoundURL);
                                       request.method = URLRequestMethod.POST;
                                       var variables:URLVariables = new URLVariables();
                                       variables.dummy = "";
                                       request.data = variables;
                                       loader.load(request);
                                     }


                                    <mx:VBox click="goodHandler()"/>

                                    <mx:VBox click="securityExceptionHandler()" />


                                  </s:Application>

                                  • 14. Re: HTTPService Gumbo sandbox violation
                                    Kishan M V Adobe Employee

                                    Port 37813 is used by Network Monitor. Currently the port number is not customizable. Please log a bug to make the port numbers customizable in network monitor. If you are using the same port number in any other application please disable network monitor or change the port number in that application.

                                     

                                    Thanks,

                                    Kishan