Skip to content

Commit

Permalink
fix: force ip4 for getLocalIp to resolve mdns issues (flybywiresim#105)
Browse files Browse the repository at this point in the history
Credits to @Nufflee
  • Loading branch information
Saschl authored Nov 25, 2023
1 parent d9464f2 commit 6c20075
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/server/src/utilities/network.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class NetworkService implements OnApplicationShutdown {
*/
async getLocalIp(defaultToLocalhost = false): Promise<string | undefined> {
return new Promise<string | undefined>((resolve) => {
const conn = createConnection({ host: 'api.flybywiresim.com', port: 443, timeout: 1000 })
const conn = createConnection({ host: 'api.flybywiresim.com', port: 443, timeout: 1000, family: 4 })
.on('connect', () => {
const { address } = conn.address() as AddressInfo;
// Calling destroy on every event to make sure simbridge can shut down cleanly
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fbw-simbridge",
"version": "0.5.1",
"version": "0.5.2",
"description": "The simbridge server for FBW addons for various tasks the addons themselves can't achieve",
"author": "",
"private": false,
Expand Down

0 comments on commit 6c20075

Please sign in to comment.