How to create http server in browser using javascript? - Stack Overflow

I am implement html5 player. It is similar to streaming, but it is not strictly streaming. First I trie

I am implement html5 player. It is similar to streaming, but it is not strictly streaming.

First I tried. Using Media Source Extensions. But I can not implement seeking. I do not know the byte offset.

So I thought. If you can create an http server in your browser, I can only respond to range requests.

Can I create http server in browser using javascript? It is support mobile/pc browser. It is must support mobile/pc browser.

I am implement html5 player. It is similar to streaming, but it is not strictly streaming.

First I tried. Using Media Source Extensions. But I can not implement seeking. I do not know the byte offset.

So I thought. If you can create an http server in your browser, I can only respond to range requests.

Can I create http server in browser using javascript? It is support mobile/pc browser. It is must support mobile/pc browser.

Share Improve this question asked Sep 6, 2017 at 3:23 hahahaha 4611 gold badge4 silver badges10 bronze badges 4
  • 1 The short answer is no, the browser is a browser, and can't be a server. It doesn't have permission to access the operating system – Mikkel Commented Sep 6, 2017 at 3:26
  • You cannot. If you are using a browser which allows extensions use them eg: chrome.google./webstore/detail/web-server-for-chrome/… – Gary Commented Sep 6, 2017 at 3:56
  • You could build it using WebRTC, which allows P2P munication. It wouldn't be a "real" HTTP server though. – Mikael Dúi Bolinder Commented Nov 6, 2021 at 23:24
  • It is possible to run a "real" HTTP server in a browser using a virtual machine with a reverse proxy tunnel. A server in WebVM can connect to clients through Tailscale Funnel, for example. – Anderson Green Commented May 20, 2024 at 21:33
Add a ment  | 

1 Answer 1

Reset to default 6

Can I create http server in browser using javascript?

No. Regular browser Javascript cannot create a web server. Browser Javascript was not given that capability and since you cannot create your own TCP server either, you cannot even build your own http server.

To do something like that, you'd have to have a browser extension that used some native code to set up an http server. But, even if you did that, you'd probably have firewall issues since most clients are not directly reachable by other clients unless they happen to be on the same sub-network as clients are usually behind a firewall.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744226547a4564034.html

相关推荐

  • How to create http server in browser using javascript? - Stack Overflow

    I am implement html5 player. It is similar to streaming, but it is not strictly streaming. First I trie

    8天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信