Send and receive msg in js.