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
1 Answer
Reset to default 6Can 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
评论列表(0条)