How could I directly trigger a very simple on localhost and a known port listening server from my in

Discussion in 'Javascript' started by Marc, Dec 18, 2005.

  1. Marc

    Marc Guest

    How could I directly trigger a very simple on localhost and a known port
    listening server from my internet browser client? Local host means the
    little server would be running on the client machine, where my browser
    resides. Browser would be IE, O.S. Windows 2000 or XP, and it's for an
    intranet application. The goal of the little server on the localhost client
    side would be to trigger a scanner, with the TWAIN library. Also this server
    is just some local windows executable listening on a known port, it's not
    THE server that provides javascript and html to the client. THE big Server
    runs on Linux far far away.



    Excuse me for my lack of knowledge, but since some cracks, (for which a
    little candle will burn in my local church today, it's Sunday you know, and
    it's a sin even to work today, as if I did not sin enough the past week
    anyway), well again since some posters have explained me that the <object>
    tag and related "classid" attribute do not necessarily have to point to an
    'original' active x object, this I had this idea:



    Could I then somehow use the object tag and the class id attribute to
    trigger a very simple locally running server from my Internet Explorer
    browser? This local server I then would register in the windows registry,
    just like the JRE is registered with the magic number
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" .



    And if this is not a good idea, how can I call this localhost sever on the
    client side, since I cannot do windows socket programming or something from
    html or even javascript? Or should I use a button which, as action, launches
    a new browser, on say localhost:12345? Disadvantage would be that then I got
    a new window that is of no other use then just kicking this local server,
    hence that's not very pretty either.



    For your interest, it's programming for an intranet, so some obliged
    clientside properties are accepted in the system. I should call TWAIN and
    kick a scanner from the browser. The little server running at the client
    side, would be the alternative for a JTWAIN applet, I tried earlier.
     
    Marc, Dec 18, 2005
    #1
    1. Advertising

  2. Marc

    VK Guest

    Marc wrote:
    > For your interest, it's programming for an intranet, so some obliged
    > clientside properties are accepted in the system. I should call TWAIN and
    > kick a scanner from the browser. The little server running at the client
    > side, would be the alternative for a JTWAIN applet, I tried earlier.


    You did not specify the required browser coverage (IE-only, IE/FF etc.)

    Also it is not clear if you want just trig the scanning process from
    the web page or you want to get the scan results (image/recognized
    text) back to your page.

    Overall rule is "if you do something, do it good, right and scalable".
    So I would just install free lightweight Abyss Web Server
    <http://abyss.sourceforge.net/> and let it run on http://127.0.0.0 or
    any other LAN IP of your choice. It takes memory less than Notepad.

    Then from your web application you can:
    <span onclick="
    document.images['image01'].src =
    http://127.0.0.0/cgi-bin/your_twain_source.exe?param1=foo&param2=bar
    ">Get scan results</span>

    Simplier solution - better it is ;-)
     
    VK, Dec 18, 2005
    #2
    1. Advertising

  3. Marc

    Marc Guest

    "VK" <> schreef

    > You did not specify the required browser coverage (IE-only, IE/FF etc.)


    The best would be IE and FF, but I would settle for IE.

    > Also it is not clear if you want just trig the scanning process from
    > the web page or you want to get the scan results (image/recognized
    > text) back to your page.


    The image should be sent to the 'big' Linux server. If the image is there,
    another page sent from that Linux server should display the image.

    > Overall rule is "if you do something, do it good, right and scalable".
    > So I would just install free lightweight Abyss Web Server
    > <http://abyss.sourceforge.net/> and let it run on http://127.0.0.0 or
    > any other LAN IP of your choice. It takes memory less than Notepad.


    Well the little sever I made is actually nothing either, but this is
    interesting nevertheless.


    > Then from your web application you can:
    > <span onclick="
    > document.images['image01'].src =
    > http://127.0.0.0/cgi-bin/your_twain_source.exe?param1=foo&param2=bar
    > ">Get scan results</span>


    Should this not be something like:

    http://127.0.0.0:12345/ et cetera. Where 12345 is the listening address.

    The little server would be not really a port 80 http internet cgi server,
    it's nothing more then a socket listener that calls TWAIN when it is
    triggered. And I do not want to use that little server to create (much) html
    output like the Linux server would do. This servlet would just scan, and
    send to the Linux server, and the Linux sends the html to the browser.
    Eh..., I think, I have to think about it a bit myself also.

    FYI: The whole reason behind this is that the teamlead would like to cut the
    licence cost, since I already got it more or less working with the applet
    and JTWAIN. Latter has to be paid for a licence to use.

    But thanks a lot.
     
    Marc, Dec 18, 2005
    #3
  4. Marc

    VK Guest

    <not a script issue>

    Marc wrote:
    > The best would be IE and FF, but I would settle for IE.


    A very nice way to say "our organization is IE-only so we do not care
    about others". Appreciate it. :)

    > > Then from your web application you can:
    > > <span onclick="
    > > document.images['image01'].src =
    > > http://127.0.0.0/cgi-bin/your_twain_source.exe?param1=foo&param2=bar
    > > ">Get scan results</span>

    >
    > Should this not be something like:
    >
    > http://127.0.0.0:12345/ et cetera. Where 12345 is the listening address.


    It all depends on what are you dealing with. If you just need to trig
    an executable then it really doesn't matter what port are you calling
    to: 80 or 12344 or 64000. Just give something HTTP-compliant back, at
    the very least "204 No Content"

    > The little server would be not really a port 80 http internet cgi server,
    > it's nothing more then a socket listener that calls TWAIN when it is
    > triggered. And I do not want to use that little server to create (much) html
    > output like the Linux server would do. This servlet would just scan, and
    > send to the Linux server, and the Linux sends the html to the browser.
    > Eh..., I think, I have to think about it a bit myself also.


    Really :)
    The logic (lesser extra circumastances I'm not aware of) should be just
    opposite: web page > Linux server [ > TWAIN call if needed > ] > HTTP
    response back to the web page.

    </not a script issue>
     
    VK, Dec 18, 2005
    #4
  5. Marc

    marc Guest

    VK:

    > A very nice way to say "our organization is IE-only so we do not care
    > about others". Appreciate it. :)


    No, no, no, we use both mozilla firefox and internet explorer. The case
    is, that this browser client would be a special client anyway, the one
    ordernador in the intranet that has the scanner near it, and the twain
    dll installed. So if one of the client properties would be, obliged IE
    use, it would be excepted.

    But the posibility that the software still would be browser
    independant, could be appreciated. I mean, if we really loved Bill, we
    probably would not use Linux for the server OS.
     
    marc, Dec 19, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Garbados
    Replies:
    5
    Views:
    474
    Bob Garbados
    Dec 22, 2004
  2. kai
    Replies:
    6
    Views:
    601
    Steven Cheng[MSFT]
    Nov 28, 2005
  3. Christian von Essen

    Listening socket not seen outside of localhost

    Christian von Essen, Jun 21, 2004, in forum: Python
    Replies:
    2
    Views:
    438
    Christian von Essen
    Jun 21, 2004
  4. olivier.melcher

    Help running a very very very simple code

    olivier.melcher, May 12, 2008, in forum: Java
    Replies:
    8
    Views:
    2,328
  5. koicat
    Replies:
    0
    Views:
    243
    koicat
    Jul 2, 2010
Loading...

Share This Page