Skip to main content
July 14, 2009
Question

GEO Lock in C++ or AS module?

  • July 14, 2009
  • 1 reply
  • 857 views

I would like to create geo locking module which would react per-file/stream. This means that one particular file which will be streamed via FMS can be geolocked to one country (e.g. Lost can be viewed only by USA viewers (IPs)).

Flash video player connects with nc.connect() and plays file with ns.play() method. Geolocking would happend on ns.play() since some files/live streams are locked to some countries (not everything is geolocked and once they are, are not geolocked to same countries so everything happend on per file basis).

Can this module be done in Actionscript or is it necessary to use C++ module?

Thank you in advance.

    This topic has been closed for replies.

    1 reply

    July 14, 2009

    It can be done with server side actionscript, but it will require the support of a webservice. One of the projects I'm working on now does just that... SSAS connects up to a php service and sends the IP, and the php service handles the lookup against my geoip database.

    I suppose you -could- do the whole thing with actionscript (using a CSV version of the geopip data and reading it line by line), but I haven't tried that myself and I don't know how resource intensive it would be. The geoip database is a lot of data to deal with, and reading through it to find an IP range might take a while.

    July 14, 2009

    Does this apply to my case too: I need to do this per file basis which means that webservice call to geoip ws will not happen before I get requested file on ns.play(file). I'll have actually 2 files on the server:

    videoFile.mp4

    and

    videoFile.dat

    In .dat file will be metadata which will tell FMS if this file is geolocked to some country or not and based on that data FMS will react.

    I'll use maxmind geoip database.

    I only found SSAS examples of onConnect events and never onPlay which happens after connect event, when connection is already established.

    It would be really nice if this is solvable by using SSAS, but for now I still don't know how

    I saw that this can be  done with C++ Auhtorization module, but I'm not used to C++, I like actionscript more.

    If you (or someone else) can help me further I'll really appreciate your help.