Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9199063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:26:25+00:00 2026-06-17T22:26:25+00:00

I’m trying to communicate from the browser with a 3rd party video conferencing app

  • 0

I’m trying to communicate from the browser with a 3rd party video conferencing app running on my local machine using Flex/Flash. The idea being that users can login on our webpage, the page in turn tells the local app to open and go to the proper chat room. Flash is needed as a bridge to bypass the mixed sources warning. My AS code:

    public function Check():void {  
        import flash.events.SecurityErrorEvent;
        import flash.external.ExternalInterface;
        import flash.net.Socket;
        import flash.system.Security;

        var mySocket:Socket = new Socket();
        Security.loadPolicyFile('xmlsocket://127.0.0.1:63457');

        mySocket.addEventListener(Event.CONNECT, onConnect);
        mySocket.addEventListener(Event.CLOSE,onClose);
        mySocket.addEventListener(IOErrorEvent.IO_ERROR, onError);
        mySocket.addEventListener(ProgressEvent.SOCKET_DATA, onProgress);
        mySocket.addEventListener(DataEvent.DATA, onData);
        mySocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

        function onConnect(event:Event):void {
            trace('connect');
        }

        function onClose(event:Event):void {
            trace('close');
        }

        function onProgress(event:ProgressEvent):void {
            trace('Progressevent fired');
            var output:String = mySocket.readUTFBytes(mySocket.bytesAvailable);
            ExternalInterface.call("alert", output);
        }

        function onData(event:DataEvent):void {
            trace('onData fired');

        }

        function onSecurityError(event:ErrorEvent) : void {
            trace("SECURITY ERROR : " +  event.text);
            ExternalInterface.call("alert", 'error: ' + event.text, 0);
        }

        function onError(event:ErrorEvent) : void {
            trace("ERROR : " +  event.text);
            ExternalInterface.call("alert", 'error: ' + event.text, 0);
        }

        mySocket.connect("127.0.0.1", 63457);
        mySocket.writeMultiByte('GET /?url=http://app.mydomain.com HTTP/1.1', 'UTF-8');
        mySocket.flush();
    };

Running locally all goes well and the ‘onProgress’ listener is fired and I see the app responding to the request . Running from a different domain however fails. I do not get sandbox errors, it’s just like the call isn’t happening. Remote debugger suggest that the connection is made successfully.

As you can probably see from the code I am a beginner at AS3 but I did quite a bit of research before asking this question here. I hope someone can help. Tried this code in Flash Pro, Flash Builder (both as AS Project and Flex Project), same results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:26:27+00:00Added an answer on June 17, 2026 at 10:26 pm

    It looks like this was a timing issue; The mySocket.writeMultiByte call happened before the socket was ready to exchange data. Making the call in the connecthandler solved the issue.

    Thanks for the logging suggestion, really helped!

    Code:

        import flash.events.SecurityErrorEvent;
        import flash.events.HTTPStatusEvent;
        import flash.external.ExternalInterface;
        import flash.net.Socket;
        import flash.system.Security;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
    
        var mySocket:Socket = new Socket();
    
        mySocket.addEventListener(Event.CONNECT, onConnect);
        mySocket.addEventListener(Event.CLOSE,onClose);
        mySocket.addEventListener(IOErrorEvent.IO_ERROR, onError);
        mySocket.addEventListener(ProgressEvent.SOCKET_DATA, onProgress);
        mySocket.addEventListener(DataEvent.DATA, onSocketData);
        mySocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
    
        function onConnect(event:Event):void
        {
            trace('connect');
            // ready to send!
            mySocket.writeMultiByte('GET /?url=http://app.mydomain.com HTTP/1.1', 'UTF-8');
        }
    
        function onClose(event:Event):void
        {
            trace('close');
        }
    
        function onProgress(event:ProgressEvent):void
        {
            var output:String = mySocket.readUTFBytes(mySocket.bytesAvailable);
            trace('Progressevent fired: \n' + output + '\n-----------');
    
        }
    
        function onSocketData(event:DataEvent):void
        {
            trace('onSocketData fired');
    
        }
    
        function onSecurityError(event:ErrorEvent):void
        {
            trace("SECURITY ERROR : " +  event.text);
        }
    
        function onError(event:ErrorEvent):void
        {
            trace("ERROR : " +  event.text);
        }
    
        mySocket.connect("127.0.0.1", 63457);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
We're building an app, our first using Rails 3, and we're having to build
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am using Paperclip to handle profile photo uploads in my app. They upload
I am currently running into a problem where an element is coming back from
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.