Skip to content

Commit

Permalink
Merge pull request #46 from ipfs/feat/override-mux-prefs
Browse files Browse the repository at this point in the history
add env var for overriding muxer prefs
  • Loading branch information
whyrusleeping committed May 6, 2016
2 parents 0436764 + 2d0c57e commit 36335e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions p2p/net/swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package swarm
import (
"fmt"
"io/ioutil"
"os"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -48,6 +50,11 @@ func init() {
msstpt.AddTransport("/yamux/1.0.0", ymxtpt)
msstpt.AddTransport("/spdy/3.1.0", spdy.Transport)

// allow overriding of muxer preferences
if prefs := os.Getenv("LIBP2P_MUX_PREFS"); prefs != "" {
msstpt.OrderPreference = strings.Fields(prefs)
}

PSTransport = msstpt
}

Expand Down

0 comments on commit 36335e4

Please sign in to comment.