rafi1212122 / BH3_PS

A private server implementation for a third impact game sea mainly but should also work for glb and probably cn too
153 stars 38 forks source link

fix mongodb ipv6 localhost problem #15

Closed pfyy closed 1 year ago

pfyy commented 1 year ago

the default installation of mongodb does not listen to ipv6 localhost ::1, but node will resolve localhost to ::1, which will lead to db connection problem https://stackoverflow.com/questions/73133094/why-can-i-connect-to-mongo-in-node-using-127-0-0-1-but-not-localhost https://stackoverflow.com/questions/69957163/mongooseserverselectionerror-connect-econnrefused-127017-in-node-v17-and-mon image (on my ipv6 enabled windows) mongodb default configuration is given below:

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1

image