I'm already handle the sanitization in my server side, any improper input text like <script>alert('hi')</script> can be handle properly. But because I also pass around data using websocket, so this part is broken if user send
<script>alert('hi')</script>
I found encodeURIComponent but confused with encodeURI, which one is for xss handling in client side?
~!@#$&*()=:/,;?+'encodeURIComponent() will not encode:~!*()'now you decide! . But can you really trust client side?