locked
Web Socket Server on Windows Tablets RRS feed

  • Question

  • Hi,

    We are developing a WIndows STore app for windows 8 to be deployed on a WIndows 8 tablet. 

    Please give ur views on below.

    1. We have libwebsocket server being compiled for windows 8 . Hope, we can directly execute this executable server on Windows 8 tablets.

    2. Hope we can establish a seamless websocket communication to this server from a javascript /html5 code running as a windows store app .

    3. please note both of the above are running on same tablet.

    4. Hope there are no security restrictions with this.

    Thanks

    Tuesday, July 9, 2013 11:15 AM

Answers

  • Hi Sankarshana,

    The overall scenario is not supported. Windows Store apps cannot depend on or communicate with services on the localhost.

    1. How can I drop the server executable directly on the windows 8 pro tablet and run it ?

    The same way you drop the server executable on any other Windows 8 Pro system.

    2. Is this possible on windows tablets?

    It depends on what you mean by "this". Being on a tablet form factor is generally irrelevant. Windows 8 Pro tablets are Windows 8 Pro systems and can do anything that any other Windows 8 Pro system can do.

    Windows Store apps cannot connect to web services on the localhost (an exception can be created for testing and debugging, but the app cannot create an exception for production).

    --Rob

    Tuesday, July 9, 2013 2:26 PM
    Moderator

All replies

  • Hi,

    There is a need to develop a server which will act as a socket listener for incoming requests. I have developed this on a windows 8 desktop machine.

    The requests would come from a windows store app's Javascript (web socket requests). The windows store app would be deployed on a windows tablet (running windows 8 pro Intel).

    1. How can I drop the server executable directly on the windows 8 pro tablet and run it ?

    2. Is this possible on windows tablets?

    Thanks


    Tuesday, July 9, 2013 11:11 AM
  • Hi Sankarshana,

    The overall scenario is not supported. Windows Store apps cannot depend on or communicate with services on the localhost.

    1. How can I drop the server executable directly on the windows 8 pro tablet and run it ?

    The same way you drop the server executable on any other Windows 8 Pro system.

    2. Is this possible on windows tablets?

    It depends on what you mean by "this". Being on a tablet form factor is generally irrelevant. Windows 8 Pro tablets are Windows 8 Pro systems and can do anything that any other Windows 8 Pro system can do.

    Windows Store apps cannot connect to web services on the localhost (an exception can be created for testing and debugging, but the app cannot create an exception for production).

    --Rob

    Tuesday, July 9, 2013 2:26 PM
    Moderator
  • Any responses to this please
    Wednesday, July 10, 2013 6:31 AM
  • Hi Sankarshana,

    The overall scenario is not supported. Windows Store apps cannot depend on or communicate with services on the localhost.

    1. How can I drop the server executable directly on the windows 8 pro tablet and run it ?

    The same way you drop the server executable on any other Windows 8 Pro system.

    2. Is this possible on windows tablets?

    It depends on what you mean by "this". Being on a tablet form factor is generally irrelevant. Windows 8 Pro tablets are Windows 8 Pro systems and can do anything that any other Windows 8 Pro system can do.

    Windows Store apps cannot connect to web services on the localhost (an exception can be created for testing and debugging, but the app cannot create an exception for production).

    --Rob

    Thanks Rob.

    My scenario is, WIndows store apps (javascript) to connect to a websocket server thats running locally (through localhost).. is this also not allowed?

    Wednesday, July 10, 2013 12:19 PM
  • Windows Store apps cannot depend on or communicate with services on the localhost.
    Wednesday, July 10, 2013 5:31 PM
    Moderator
  • Windows Store apps cannot depend on or communicate with services on the localhost.

    Thanks, what if those services are spawned from a windows store app itself ??

    Like, an installation of windows store app will spawn a parallel execution entity (a thread for example) in which the server is running on a different port? This will not violate the sandboxing...

    Thursday, July 11, 2013 9:06 AM
  • Yes, an app can communicate with itself. If your "service" is part of the app itself then you are fine.

    --Rob

    Thursday, July 11, 2013 1:50 PM
    Moderator
  • Yes, an app can communicate with itself. If your "service" is part of the app itself then you are fine.

    --Rob

    thanks Rob..
    Sunday, July 14, 2013 11:28 AM
  • Although note that the service must be compatible with the app store -- that is, it can only use the allowed set of APIs, etc.  This might be a problem for your libwebsocket server

    My team is always interested in how people are using WebSockets.  What kind of app are you using?  And what websocket feature was the most compelling feature?


    Network Developer Experience Team (Microsoft)

    Tuesday, July 16, 2013 6:05 PM
  • Thanks for the details. Let me give some more details here and I request ur team to point out any issues / differences..

    1. When I say spinning off a service from windows store app (javascript based app), what I mean is that,

    I will mostly have a winRT_C++ component which will expose let's say a method called "execute". This method will be called from javascript .

    2. When this method (assync method) is called, the implementation of this method will create a native thread 

    and will open a websocket server on that thread .

    3. This thread will be listening to websocket connections.

    4. Javascript will later (from other button clicks) will post requests to this websocket server thread and keep going.

    do u see any issues here.? 

    I understand that, the thread must do things that are withing allowed limits as per windows store app. But, the thread function is a C++ code which will probably create some locla websocket sockets and will wait on it etc...

    Thanks


    Wednesday, July 17, 2013 7:21 AM
  • Thanks again.

    I find it weird and wondering why and how I am able to do the below.

    Development and testing Environment: Windows 8 Machine with VS 2012 -Express for WIndows 8 installed.

    1. I have created a javascript Project (Phone gap based) which renders some HTML5 UI.

    2. I have developed a desktop plain C++ application which when executed, will start a WebSocket Server (through Libwebsockets) and will wait for connections.

    3. I executed the exe seperately.

    4. I run the Javascript Project through VS-2012 IDE in "SImulator " mode (because I dont have a Surface tablet yet).

    5. This Javascript will connect to the WebSocket server and will get some data and will display.

    This whole thing works in simulator mode or as an "Installed APP" when run through the VS-2012 on a surface tablet. (Pls note , VS is installed on a surface tablet).

    QUestion is, why the javascript based windows store app is able to connect to the WebSocket Server which is deployed as an EXE? WHy the restrictions are not applying?

    I really want to get into the details to once for all clear out this.

    Thanks..

    Thursday, July 18, 2013 10:00 AM
  • Thanks for the details. Let me give some more details here and I request ur team to point out any issues / differences..

    1. When I say spinning off a service from windows store app (javascript based app), what I mean is that,

    I will mostly have a winRT_C++ component which will expose let's say a method called "execute". This method will be called from javascript .

    2. When this method (assync method) is called, the implementation of this method will create a native thread 

    and will open a websocket server on that thread .

    3. This thread will be listening to websocket connections.

    4. Javascript will later (from other button clicks) will post requests to this websocket server thread and keep going.

    do u see any issues here.? 

    I understand that, the thread must do things that are withing allowed limits as per windows store app. But, the thread function is a C++ code which will probably create some locla websocket sockets and will wait on it etc...

    Thanks


    Network Developer Exp Team,

    any replies to this pls.

    Friday, July 19, 2013 6:01 AM
  • Thanks again.

    I find it weird and wondering why and how I am able to do the below.

    Development and testing Environment: Windows 8 Machine with VS 2012 -Express for WIndows 8 installed.

    1. I have created a javascript Project (Phone gap based) which renders some HTML5 UI.

    2. I have developed a desktop plain C++ application which when executed, will start a WebSocket Server (through Libwebsockets) and will wait for connections.

    3. I executed the exe seperately.

    4. I run the Javascript Project through VS-2012 IDE in "SImulator " mode (because I dont have a Surface tablet yet).

    5. This Javascript will connect to the WebSocket server and will get some data and will display.

    This whole thing works in simulator mode or as an "Installed APP" when run through the VS-2012 on a surface tablet. (Pls note , VS is installed on a surface tablet).

    QUestion is, why the javascript based windows store app is able to connect to the WebSocket Server which is deployed as an EXE? WHy the restrictions are not applying?

    I really want to get into the details to once for all clear out this.

    Thanks..

    Network Developer exp team, Rob

    any replies to this pls

    Thx

    Friday, July 19, 2013 6:01 AM
  • The restriction is not in place for projects in development.  The restrictions go into place when deployed.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, July 30, 2013 3:03 PM
    Moderator
  • Matt,

    thanks for clarification on restriction being ON at deployment time and not at development time.

    I request (if possible), pls publish this info somewhere in MSDN so that, people will not get confused. Thanks and appreciate it..

    Wednesday, July 31, 2013 6:58 AM
  • Wednesday, July 31, 2013 6:24 PM
    Moderator