471,066 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

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

Jul 18 '05 #1
2 2459
Jos Yule wrote:
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)


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

http://xhaus.com/alan/python/proxies.html

Istvan.
Jul 18 '05 #2
Istvan Albert wrote:
Jos Yule wrote:
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)

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

http://xhaus.com/alan/python/proxies.html

Istvan.


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
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by C-man | last post: by
2 posts views Thread by agostino.russo | last post: by
3 posts views Thread by Brecht Yperman | last post: by
4 posts views Thread by aki | last post: by
4 posts views Thread by accyboy1981 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.