?
Solved

http server question

Posted on 2014-04-16
10
Medium Priority
?
257 Views
Last Modified: 2014-04-28
Hi Experts,
I know this is almost 100% not possible, but just in case.  Is it possible to listen on a port on a machine (on localhost), where if the server is running in a given session, it won't be visible to other sessions?

Or, is there a way to communicate from a web browser other than using plugins and other than using http requests to something on localhost?

Just brainstorming.

Thanks,
Mike
0
Comment
Question by:thready
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 40004752
That doesn't make a whole lot of sense.  The whole purpose of web browsers is to communicate using HTTP.  They can also use FTP.

The software that most frequently does something like you're talking about is your anti-virus software.  AV software usually sets up a 'proxy' that all traffic is routed thru so that it can be checked for viruses and malware.  This is way beyond 'web programming'.
0
 
LVL 86

Expert Comment

by:jkr
ID: 40004849
What bowser are you thinking of? Would "rolling your own" be an option?
0
 
LVL 1

Author Comment

by:thready
ID: 40004882
Hi Dave, this is in fact way beyond web programming...  :)   Working on a very complicated piece of enterprise software that communicates to many different types of servers...

jkr - nope - we need to stick to chrome, firefox and IE...

I knew my question was a shot in the dark, just hoping for some open minded innovation!  Not always possible though- especially with the tightening of the browser security models.
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40004976
I don't believe there is any reliable native way to "talk to the browsers" other than HTTP.  While I'm certain that it is possible to hook into the browsers, it's just as likely to get 'unhooked' with the next update.  Chrome and Firefox update fairly frequently.
0
 
LVL 1

Author Comment

by:thready
ID: 40004991
Sounds like you've been having "fun" with this kind of thing as well...  And just in case - I'm not interested in talking "to" the browser - the browser remains a client in what I'm looking for.  For instance, we've used JSONP, http and https so far...  even a plugin where the former wasn't possible...  I'm always open to anything else people might have up their sleeve....

Thanks,
Mike
0
 
LVL 86

Expert Comment

by:jkr
ID: 40005005
>>nope - we need to stick to chrome, firefox and IE...

What a pity - we did something similar recently by creating our own WebKit-based browser, adding a custom communications layer and connecting that back to the browser via a Qt bridge...
0
 
LVL 1

Author Comment

by:thready
ID: 40005055
That sounds very interesting!  I'm not sure I get it though...

I just looked up Qt bridge - looks like you've got direct access to your thick application code through javascript because the underlying object model is QObject like in the declarative framework?
0
 
LVL 86

Accepted Solution

by:
jkr earned 1000 total points
ID: 40005087
Yup, that's it. We mainly need a JS interaction with the server without a HTTP connection and just created a simple driver class like

class CommDriver : public QObject {

    Q_OBJECT

    CommDriver(QWebFrame*);
    virtual ~CommDriver();

    int  CommRequest(const QString& s, CommThread* p);
    void CommResult(const QString& sId, const QString& sRes);
    bool HasConnector() const { return m_hDll && m_pReq;}


public slots:
    Q_INVOKABLE
    bool createRequest(const QString& sReqId, const QString& sReq);

signals:

    void returnRequest(const QString& sReqId, const QString& sResponse);

    const QString& GetRequest() const { return m_sRequest;}
    void SetRequest(const QString& s) { m_sRequest = s;}

    const QString& GetResponse() const { return m_sResponse;}
    void SetResponse(const QString& s) { m_sResponse = s;}

protected:

    QString m_sRequest;
    QString m_sResponse;

protected:

    QWebFrame* m_frame;

    HINSTANCE m_hDll;
    FPTR_CommClientRequest m_pReq;

    unsigned m_unThreadCount;
    QThreadPool m_pool;

private slots:
    void addJSObject();
};

Open in new window


that was then added via

            // Signal is emitted before frame loads any web content:
            QObject::connect(m_frame, SIGNAL(javaScriptWindowObjectCleared()),
                             this, SLOT(addJSObject()));

Open in new window


That way, the loaded JS code could "talk" to the server via an arbitrary connection implemented in the driver. Just out of fun, we even created a small server in a DLL that the driver loaded (you can see the handle declared in the snippet).
0
 
LVL 1

Author Comment

by:thready
ID: 40005103
Very cool.  I've been getting hooked on Qt mobile.  Particularly QML...  Thanks for sharing!
0
 
LVL 1

Author Closing Comment

by:thready
ID: 40028138
Thanks guys, this answers my question - it's not possible!  :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question