mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 11:32:00 -08:00
added charsets support
This commit is contained in:
parent
95585866c2
commit
3a51dce786
@ -1,6 +1,9 @@
|
|||||||
package xmpp // import "fluux.io/xmpp"
|
package xmpp // import "fluux.io/xmpp"
|
||||||
|
|
||||||
import "os"
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Address string
|
Address string
|
||||||
@ -12,4 +15,5 @@ type Config struct {
|
|||||||
Retry int // Number of retries for connect
|
Retry int // Number of retries for connect
|
||||||
ConnectTimeout int // Connection timeout in seconds. Default to 15
|
ConnectTimeout int // Connection timeout in seconds. Default to 15
|
||||||
Insecure bool // set to true to allow comms without TLS
|
Insecure bool // set to true to allow comms without TLS
|
||||||
|
CharsetReader func(charset string, input io.Reader) (io.Reader, error) // passed to xml decoder
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,7 @@ func (s *Session) setProxy(conn net.Conn, newConn net.Conn, o Config) {
|
|||||||
s.socketProxy = newSocketProxy(newConn, o.PacketLogger)
|
s.socketProxy = newSocketProxy(newConn, o.PacketLogger)
|
||||||
}
|
}
|
||||||
s.decoder = xml.NewDecoder(s.socketProxy)
|
s.decoder = xml.NewDecoder(s.socketProxy)
|
||||||
|
s.decoder.CharsetReader = o.CharsetReader
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Session) open(domain string) (f streamFeatures) {
|
func (s *Session) open(domain string) (f streamFeatures) {
|
||||||
|
Loading…
Reference in New Issue
Block a user