Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

http server question

Posted on 2014-04-16
10
Medium Priority
?
258 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

610 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