First of all you should choose the network solution you want to work with.
This thread is a good starting point: What are the pros and cons of available network solutions/assets
Check their documentation, available demos and tutorials, etc.
About embedding the game in a webapp… given it’s a 2D game, why going with Unity, instead of developing the game directly in HTML5/JS? Some of the solutions listed in the above thread also offer native HTML5/JS API.