最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to open a HTTP server in react native - Stack Overflow

programmeradmin7浏览0评论

I want to be able to send music to sonos using its API. Unfortunately the only way I know is to send an URI to the device so it can download it.

I have visited already the package react-native-httpserver. This one has not been tested in Android. So I had a look over Android's nanoHTTPD and other similar packages in iOS as CocoaHTTPServer is.

It should not very difficult to create a wrapper over those packages to build something cross-platform but I wonder if there is another solution in Javascript or some work developing over react-native-tcp

I want to be able to send music to sonos using its API. Unfortunately the only way I know is to send an URI to the device so it can download it.

I have visited already the package react-native-httpserver. This one has not been tested in Android. So I had a look over Android's nanoHTTPD and other similar packages in iOS as CocoaHTTPServer is.

It should not very difficult to create a wrapper over those packages to build something cross-platform but I wonder if there is another solution in Javascript or some work developing over react-native-tcp

Share Improve this question edited May 23, 2017 at 12:17 CommunityBot 11 silver badge asked Sep 15, 2016 at 15:49 jsdariojsdario 6,85311 gold badges44 silver badges78 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 15

I'll answer my own question, time has passed by and some packages have been released. Even with limitations, but looks promising so far:

  • HTTP Static server: https://github./futurepress/react-native-static-server
  • Quite flexible (but Android only) https://www.npmjs./package/react-native-http-server
  • Limited but both platforms https://github./alwx/react-native-http-bridge

For those of you still looking for a good package to open a HTTP server in react native, react-native-http-bridge is unmaintained, but there is a maintained version:

  • react-native-http-bridge-refurbished: https://github./Alwinator/react-native-http-bridge-refurbished

Try to use react-native-fetch-blob https://github./wkh237/react-native-fetch-blob, I have used it to send pictures and It works very well. It supports both ios and Android

发布评论

评论列表(0)

  1. 暂无评论