It is not that simple. You want an http api, not a socket based one. Doing something like this:
Involves extra steps that are not needed. Accepting the http command/connection... then opening a websocket connection between browser and fop2 server (that takes time/cpu/etc), and then use the existing AMI connection on the proxy to perform a command.
Much more simpler is to just use http with no websockets at all to get the command, and then forward it via AMI or similar interfaces. In fact, Asterisk 13 already has such API in place and its named ARI.
I might write a different software using just http with no fop2 server needed in order to bridge AMI with the web, for older asterisk versions... but I think FOP2 is not the place to do it.