Quick questions!

Are assets in the asset portal cross platform (All platforms besides maybe htm5)?

Also, is there any cross platform way to secure a tcp connection to a server (Using TLS)?

I saw a forum post about luasec but I was not sure if it would work cross-platform.

Thanks

They all should be. Maybe one is not? Name one you are questioning and we can say for sure. You’re right HTML5 has some unique constraints.

There are various posts on this forum about the networking questions have you tried searching? Is the HTML5 target your concern?

@AJirenius has a lot of experience with the networking.

1 Like

Okay: The websockets asset

Yes actually I searched pretty thoroughly and I think I have answers to most of my questions. I am not super concerned about HTML5.

I have a game that I am trying migrate from Godot. Everything seems to be in order, but no way to start a secured tcp connection for Android, IOS, Windows and Mac is a deal breaker for me.

As far as I know, I need to use an extension to add luasec to my project? And that should work cross platform correct?

Thanks

Assuming this is the correct module to use, I think I have everything figured out!

The defold-websocket and defold-luasec aren’t recommended anymore.

Instead, we promote the new extension-websocket.
It will work equally well on HTML5 as the other platforms.

2 Likes

For each asset you add, you’ll need to check if they actually support your platform. Chances are they do, but it’s easier to check beforehand :slight_smile:

In cases where they use 3rd party libraries, that’s when it might be that those libraries doesn’t exist for a certain platform.

2 Likes

@James_Washington the websocket extension suggested by Mathias does support all platforms and both ws: and wss:

It works without any extra dependencies

2 Likes

Okay. Thank you for all the info.
[Edit] I can’t seem to find any documentation on how to secure the connection using extension-websocket.
Am I looking in the wrong spot?


thanks

It’s done automatically if you’re using the “wss:” protocol

Sorry I am new to using websockets.
Wouldn’t I need to pass some sort of authentication credentials before/after making a connection to secure it?

I was planning on using https or secured tcp to authenticate users server-side, but I figured websockets would work just as well if that is what defold supported.

Actually I’m sorry I think I got a bit confused!
I am going to look up some documentation but it appears the client does not need any sort of auth info

1 Like

These are two different things:

  • A secure connection (wss:// or https://) will secure the connection in such a way that you can ensure that there is no one listening to the data passing from your client to the server.
  • Authentication is a separate step that is used to identify a user trying to connect to your server. This can be done in a number of different ways. For http connections a common way is to use something called Basic Authentication where username and some kind of session token is passed in a header or in the URL itself. What is more common though is to send some kind of authentication request to the server. How this is done varies from server to server.
1 Like