Merge pull request #13 from hypafrag/xml_charset_reader_support

added charsets support
disco_info_form
Mickaël Rémond 5 years ago committed by GitHub
commit b030e8dd4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,9 @@
package xmpp // import "gosrc.io/xmpp"
import "os"
import (
"io"
"os"
)
type Config struct {
Address string
@ -12,4 +15,5 @@ type Config struct {
Retry int // Number of retries for connect
ConnectTimeout int // Connection timeout in seconds. Default to 15
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.decoder = xml.NewDecoder(s.socketProxy)
s.decoder.CharsetReader = o.CharsetReader
}
func (s *Session) open(domain string) (f streamFeatures) {

Loading…
Cancel
Save