Network pass-through/proxy server questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jos Yule

    Network pass-through/proxy server questions

    Hello all.

    I doing a project which uses Macromedia's Flash program and Python. This
    is a 'because i want to see if i can do it' kind of thing, so i know
    that there will be better/easier ways to accomplish what i'm about to
    lay out!

    I am going to use a flash app as a kind of chat app, but because Flash
    does not accept incoming socket connections, i'd like to use a small
    Python server to act as the socket proxy (i think that's the right term)
    server. I am going to have a flash app running which will connect to the
    Python server (the chat app), and i just need the Python server to
    accept new client socket connections, and pass the messages received on
    to the flash app.

    I've gotten a basic version of this running, where the flash chat app
    connects on port 9999, and the clients connect on port 8888 (just
    example port #).

    My biggest problem within the Python code is how to pass a reference to
    the flash app about which socket is associated with which
    message/client. ie. how do i 'number' the messages, so that when they
    are passed to the flash controller, it can then send back messages which
    get sent to the correct client?

    I currently have used a 'broadcast' method (using weak refs), but this,
    obviously, is not very efficient, as each socket compares an internal ID
    number against an id which is sent as part of the message from the flash
    controller app. ie. each message from a client has an ID pre-pended to
    it - "001 Hey how's it going?", and messages from the server are similar
    - "001 Kicked due to ineptness"

    Is there a way to relate socket objects with some kind of ID, directly,
    without fubaring the garbage collection stuff?

    Is this clear, or are you all just going "wtf is he talking about?" ;)

    thanks
    j

    ps. i would like to avoid using Twisted, as i want to learn how to use
    asyncore on its own, and Twisted just seems too big for what i want...
    j



  • Istvan Albert

    #2
    Re: Network pass-through/proxy server questions

    Jos Yule wrote:
    [color=blue]
    > does not accept incoming socket connections, i'd like to use a small
    > Python server to act as the socket proxy (i think that's the right term)[/color]

    Check this page for python proxies, you might find something you can
    build upon



    Istvan.

    Comment

    • Jos Yule

      #3
      Re: Network pass-through/proxy server questions

      Istvan Albert wrote:
      [color=blue]
      > Jos Yule wrote:
      >[color=green]
      >> does not accept incoming socket connections, i'd like to use a small
      >> Python server to act as the socket proxy (i think that's the right term)[/color]
      >
      >
      > Check this page for python proxies, you might find something you can
      > build upon
      >
      > http://xhaus.com/alan/python/proxies.html
      >
      > Istvan.[/color]

      Thanks for the pointer, i hope i can grok it well enough to figure out
      how to move from HTTP style connections to longer term chat style
      connections!

      j

      Comment

      Working...