A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Writing an irc client

  1. #1
    do your smiles love u? slicer4ever's Avatar
    Join Date
    Dec 2005
    Location
    in a random occurance
    Posts
    475

    resolved [RESOLVED] Writing an irc client

    hello, i'm running into major problems with writing an irc client, it works perfectly when i execute it through flash, but when i upload it to a site, it won't connect, i understand that i need an crossdomain file, i've been doing alot of research, and can't make head's or tails

    debugging shows that even though i do: Security.loadPolicyFile("http://example.com/crossdomain.xml");, it still attempts to read an crossdomain file from the target irc server, however, i don't have control over the target machine(nor should that be necessary), how do i get around this, or what am i doing wrong?

    what i really need, is a simple example of connecting to an server that i don't control to load some resources(i.e grabbing an image), where all the crossdomains file's sit, and how it's generally done, googling around, it seems this information isn't as easy to come by as i thought

    edit: also, i'm using raw sockets to connect to the irc server, if that makes a diffrence

    edit: alright, been reading alot more information, it looks like i do need to have a policy file to connect to said server, which is beyond retarded, please, someone tell me there's a way around this, but that doesn't explain why it works through flash?
    Last edited by slicer4ever; 11-24-2010 at 09:38 AM.

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    to load data from a different domain, you need either:

    1. the server with the data file - the one you're loading from - must allow the domain that hosts the swf via a crossdomain policy file.

    or...

    2. a proxy file. this is actually very simple - you just host a file on your server that outputs the contents of the file on the remote server. it can be as simple as:

    PHP Code:
    <?php
    readfile
    ("http://www.example.com/whatever.ext");
    ?>
    then you just load that file instead of the remote file.

  3. #3
    do your smiles love u? slicer4ever's Avatar
    Join Date
    Dec 2005
    Location
    in a random occurance
    Posts
    475
    unfortuantly, i don't have access to the specified remote server, and using a proxy isn't available to me, since i need to maintain an active connection, rather than using techniques such as polling, i've since moved onto using a java<->javascript<->flash bridge for my socket needs, and it's working nicely, not as effective as i want, but i'll have to wait until javascript WebSocket's are more widely available before i can drop java, or flash change's it's security structure(unlikly)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center