Sandertv / gophertunnel

General purpose library for Minecraft Bedrock Edition software written in Go
MIT License
420 stars 96 forks source link

Customizable encryptors and compressors per protocol #135

Open JustTalDevelops opened 2 years ago

JustTalDevelops commented 2 years ago

In certain cases those settings can be undesired, although they should certainly be on by default.

JustTalDevelops commented 2 years ago

It might be better to have the compressors and encryptors configurable themselves, maybe in ListenConfigs or Protocol implementations. Could be useful for custom Protocol implementations.

JustTalDevelops commented 2 years ago

It might be better to have the compressors and encryptors configurable themselves, maybe in ListenConfigs or Protocol implementations. Could be useful for custom Protocol implementations.

I think this is the way to go. It doesn't make sense to put it in ListenConfigs, as compression/encryption is really only tweaked with when using Gophertunnel over a different Protocol.

Sandertv commented 2 years ago

I wouldn't put this in Protocol either, these are both a different layer than the protocol. Without the correct compression type, you can't find the protocol.

JustTalDevelops commented 2 years ago

Where would you put this then? Listen/Dial configs?

Sandertv commented 2 years ago

Probably, honestly.

Sandertv commented 2 years ago

Coming back to this, with 1.19.30 coming, it would probably make sense to put this in the protocol, as we can now find the protocol before we need to (de)compress or encrypt.