简体   繁体   English

是否可以在桌面上创建从手机到 java 的连接(websocket?)?

[英]Is it possible to create connection (websocket?) from mobile phone to java on desktop?

I would like to send data directly from my Android phone to Java in the web browser on my desktop.我想在桌面上的 web 浏览器中将数据直接从我的 Android 手机发送到 Java。 Both devices may not be on the same su.net.两个设备可能不在同一个 su.net 上。 Is it actually possible, or do the both devices first need to connect to a common server on the Inte.net that relays the data between two websockets ?这实际上是可能的,还是这两个设备首先需要连接到在两个websocket之间中继数据的 Inte.net 上的公共服务器?

Since both applications (browser + app) are both websocket clients, you need a third application acting as the websocket server.由于两个应用程序(浏览器 + 应用程序)都是 websocket 客户端,因此您需要第三个应用程序充当 websocket 服务器。 This third application has to offer the websocket(s) that both applications connect to ws://third-app/socket .第三个应用程序必须提供两个应用程序都连接到ws://third-app/socket的 websocket。

If this app is running locally in your.network or on a server on the Inte.net is up to you.此应用程序是在您的网络中本地运行还是在 Inte.net 上的服务器上运行由您决定。 But if both devices are in different su.nets your firewalls/routers have to ensure that both devices can reach the websocket server.但是如果两个设备都在不同的 su.net 中,您的防火墙/路由器必须确保两个设备都可以到达 websocket 服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过调制解调器将Java移动应用程序从手机连接到台式机上的服务器 - Connecting a java mobile application from a phone to a Server on a desktop through a modem 可以将Java WebSocket与桌面应用程序一起使用吗? - Is it possible to use Java WebSocket with desktop application? 是否可以仅在 Java 中为本地主机创建安全 Websocket? - Possible to create Secure Websocket in Java for localhost only? 是否可以使用 MySQL 创建桌面应用程序和 android 应用程序(移动)? - Is it possible to create a desktop apps and an android apps (mobile) with MySQL? 用Java关闭websocket连接 - Close websocket connection with Java 是否可以使用 java 编码访问手机文件(pdf) - is it possible to access mobile phone files(pdf) using java coding 从图库设置图像为桌面电话的背景(android-java) - set an image from gallery for background of desktop phone (android-java) 是否可以从javax.websocket.Session实例获取Websocket连接Origin? - Is it possible to get Websocket connection Origin from a javax.websocket.Session instance? 是否可以使用 Java 后端和 Web 技术 UI 创建桌面应用程序 - Is it possible to create Desktop Application using Java backend & Web Technologies UI 可以使用 Java 和 Electron JS 创建桌面应用程序吗? - It is possible to create a Desktop app using Java and Electron JS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM