Connection Refused :4984/bucketName

I am trying to connect sync gateway which is on external IP, Problem is that I am not able to connect with sync gateway by code (trying to do replication) . It is continuesly emmiting error as Connection refused by :4984/bucketName.

How to add a sync_user ?

duplicate of Connection refuse 4984 port couchbase lite.